使用pip离线安装python第三方模块
作者:互联网
安装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
标签:mirrors,python,离线,pypisoft,tencent,pip,root,cloud 来源: https://www.cnblogs.com/changfeng1959/p/16490149.html