安装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
列出模块
# pip list
卸载模块
# pip uninstall urllib3 -y
aaa