比如我要安装一个lxml ,-i 是指定 pip源
# pip3 install lxml -i https://pypi.tuna.tsinghua.edu.cn/simple
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting lxml
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/8d/63/03f25363b26fa27a733d920554d73e34390830b3b5c012d7a9f721d1dc2d/lxml-4.8.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl (6.4 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 6.4/6.4 MB 11.5 MB/s eta 0:00:00
Installing collected packages: lxml
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
cvemap 1.0.1 requires openpyxl>=3.0.7, which is not installed.
cvemap 1.0.1 requires paramiko>=2.7.2, but you have paramiko 2.6.0 which is incompatible.
Successfully installed lxml-4.8.0
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
提示 openpyxl 没有安装,并且 paramiko 需要升级高于2.7.2的版本
于是安装 openpyxl
pip3 install openpyxl -i https://pypi.tuna.tsinghua.edu.cn/simple
升级 paramiko
pip3 install --upgrade paramiko==2.7.2 -i https://pypi.tuna.tsinghua.edu.cn/simple
再次安装 lxml,成功
pip3 install lxml -i https://pypi.tuna.tsinghua.edu.cn/simple