在终端进入目录: cd ~/.pip/
如果没有 .pip 文件夹,新建文件夹: mkdir .pip
cd .pip
nano 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