终端中输入命令:

mkdir ~/.pip   #新建.pip目录
touch pip.conf   #新建pip.conf文件
vi pip.conf   #编辑pip.conf文件

阿里源:

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

清华源:

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

豆瓣源:

[global]
index-url = http://pypi.douban.com/simple
[install]
trusted-host=pypi.douban.com

Q.E.D.


Nothing really matters to me!