[Python] pip specify the source

Permanent specify the source

Edit ~/.pip/pip.conf:

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

Write the following:

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

Effective immediately:

source ~/.pip/pip.conf

Temporary specify the source

pip install {库名} --index='xxxx' --trusted-host='xxxx' 
Published 628 original articles · won praise 863 · Views 1.85 million +

Guess you like

Origin blog.csdn.net/JNingWei/article/details/104879130