当前位置: 首页 > news >正文

python设置永久的国内镜像源

python设置永久的国内镜像源

命令行配置(推荐)

通过pip config命令直接修改全局配置:

# 设置全局镜像源
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple/

# 设置信任的主机(解决HTTPS证书问题)
pip config set global.trusted-host pypi.tuna.tsinghua.edu.cn

验证配置

复制
pip config list