【python】pip指定源

永久性指定源

编辑 ~/.pip/pip.conf

mkdir ~/.pip
vim ~/.pip/pip.conf

写入如下内容:

[global]
trusted-host = xxxx
index-url = xxxx

立即生效:

source ~/.pip/pip.conf

临时性指定源

pip install {库名} --index='xxxx' --trusted-host='xxxx' 

你可能感兴趣的:(Python,编程)