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/simple
[install]
trusted-host=mirrors.aliyun

5.保存并退出

:wq

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

参考:

Linux 服务器配置pip源 - 简书 (jianshu)

更多推荐

Linux永久修改pip配置源