1.在根目录下创建.pip文件夹

mkdir ~/.pip

2.在创建好的.pip文件夹下创建pip源配置文件

touch ~/.pip/pip.conf

3.使用vim打开pip.conf配置文件

vim ~/.pip/pip.conf

4.添加下述内容

[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host=mirrors.aliyun.com

5.保存并退出

:wq

以上就完成了pip源的配置过程。

附换源命令:

pip config set global.index-url   源地址
 
例如换成阿里云源则需要执行:
pip config set global.index-url http://mirrors.aliyun.com/pypi/simple/

总结

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。