安装pip2pi
# tar zxf pip2pi-0.8.2.tar.gz # cd pip2pi-0.8.2/ # python setup.py build # python setup.py install
修改默认pip源为国内腾讯pip源
# pip config set global.index-url https://mirrors.cloud.tencent.com/pypi/simple/ # more /root/.config/pip/pip.conf [global] index-url = https://mirrors.cloud.tencent.com/pypi/simple/ trusted-host = mirrors.cloud.tencent.com
同步包到本地目录
# mkdir pypisoft # pip2tgz /root/pypisoft/ pywbem==1.1.0
生成索引
# dir2pi /root/pypisoft/
离线安装
# pip install --index-url=file:///root/pypisoft/simple pywbem==1.1.0
原创文章,作者:wure,如若转载,请注明出处:https://blog.ytso.com/275178.html