Python pip 切换为国内镜像源

参考文章:https://codeplayer.vip/p/j7tmc

[windows]

备份记录指令:(永久全局设置pypi国内镜像源地址)

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

 [linux]

在/root/下,mkdir .pip

在/root/.pip/目录下,touch pip.conf

编辑pip.conf

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

保存,退出,设置完毕。

原文地址:https://www.cnblogs.com/brian-sun/p/13286880.html