Windows 10下Python pip快速设置国内镜像源

看了许多帖子,乱七八糟的还不能解决问题。。。
pip下载,由于默认镜像源在国外,有的包下载速度慢的一批,所以你懂的,

How

废话不多说,打开能运行怕pip终端的窗口输入两条命令即可,这里以设置清华镜像为例

>  pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple

>  pip config set install.trusted-host https://pypi.tuna.tsinghua.edu.cn

这样就会自动写入配置文件里了
如果你想要别的镜像源,比如阿里云

>  pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/
>  pip config set install.trusted-host mirrors.aliyun.com

References

  • 看这个大佬 https://zhuanlan.zhihu.com/p/106697938
  • 啥玩意 https://www.jb51.net/article/193743.htm
  • 不知所言 https://www.jianshu.com/p/3621780417be

猜你喜欢

转载自blog.csdn.net/weixin_43031092/article/details/108690238