Linux永久修改pip配置源(Centos7.9系列)

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

或者,优先选择下面的参数数据写入:

[global]
index-url = http://mirrors.aliyun.com/pypi/simple/

[install]
trusted-host = mirrors.aliyun.com


5.保存并退出

:wq


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

猜你喜欢

转载自blog.csdn.net/qq_33468857/article/details/131212781