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

mkdir ~/.pip

2.在~/.pip/pip.conf添加配置

cat << EOF >> ~/.pip/pip.conf
[global]
index-url=https://pypi.tuna.tsinghua.edu.cn/simple

[install]
trusted-host=pypi.tuna.tsinghua.edu.cn
EOF