1、前提條件
yum install python3-pip
2、在能聯(lián)網(wǎng)的機(jī)器上下載包及依賴
[root@master ~]# pip3 download -d /root/requests/ requests
Collecting requests
Downloading requests-2.28.2-py3-none-any.whl (62 kB)
|████████████████████████████████| 62 kB 110 kB/s
Saved ./requests/requests-2.28.2-py3-none-any.whl
Collecting urllib3<1.27,>=1.21.1
Downloading urllib3-1.26.14-py2.py3-none-any.whl (140 kB)
|████████████████████████████████| 140 kB 31 kB/s
Saved ./requests/urllib3-1.26.14-py2.py3-none-any.whl
Collecting certifi>=2017.4.17
Downloading certifi-2022.12.7-py3-none-any.whl (155 kB)
|████████████████████████████████| 155 kB 27 kB/s
Saved ./requests/certifi-2022.12.7-py3-none-any.whl
Collecting idna<4,>=2.5
Downloading idna-3.4-py3-none-any.whl (61 kB)
|████████████████████████████████| 61 kB 20 kB/s
Saved ./requests/idna-3.4-py3-none-any.whl
Collecting charset-normalizer<4,>=2
Downloading charset_normalizer-3.0.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (166 kB)
|████████████████████████████████| 166 kB 23 kB/s
Saved ./requests/charset_normalizer-3.0.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Successfully downloaded requests urllib3 certifi idna charset-normalizer
3放航、拷貝下載的包到離線環(huán)境
4、在離線環(huán)境下安裝
pip3 install --no-index --find-links=/root//requests/ requests