在window 配置 pip 镜像源
- 在当前计算机用户的根下、新建一个 pip 文件夹
- 在 pip 文件夹下, 新建一个 pip.ini 配置文件
- 多个镜像源可用extra-index-url = xxxxxxx1 xxxxxxx2中间用空格分隔
- trusted-host同理,空格分隔
[global]
index-url = http://mirrors.aliyun.com/pypi/simple/
extra-index-url=http://pypi.douban.com/simple/ https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host = mirrors.aliyun.com pypi.douban.com pypi.tuna.tsinghua.edu.cn
在 linux 配置镜像源
- 在当前计算机用户的根下、新建一个 .pip 文件夹
- 在 .pip 文件夹下, 新建一个 pip.conf 配置文件
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host = pypi.tuna.tsinghua.edu.cn