1. PyPI (PIP)

1.1. 直接修改配置文件

mkdir ~/.pip
echo -e "[global]
index-url = https://mirrors.aliyun.com/pypi/simple/

[install]
trusted-host=mirrors.aliyun.com" > ~/.pip/pip.conf

1.2. 通过pip config命令修改(pip>=10.0.0)

pip install -i https://mirrors.aliyun.com/pypi/simple/ pip -U
pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/