当前位置:   article > 正文

Python国内常用镜像源汇总_python国内镜像

python国内镜像

前言

    由于网络问题,直接从Python官方的PyPI仓库下载软件包可能会遇到速度慢甚至无法访问的情况。还好,有几个国内大学和组织提供了PyPI的镜像,可以显著提高下载速度和稳定性。本文将介绍几个常用的Python镜像源,并指导如何在pip中配置它们。

国内镜像地址

  • 阿里云
http://mirrors.aliyun.com/pypi/simple/
  • 1
  • 豆瓣(douban)
http://pypi.douban.com/simple/
  • 1
  • 清华大学
https://pypi.tuna.tsinghua.edu.cn/simple/
  • 1
  • 中国科学技术大学
http://pypi.mirrors.ustc.edu.cn/simple/
  • 1
  • 腾讯
http://mirrors.cloud.tencent.com/pypi/simple
  • 1

使用方式

临时换源

清华源
pip install xxxx -i https://pypi.tuna.tsinghua.edu.cn/simple

阿里源
pip install xxxx -i https://mirrors.aliyun.com/pypi/simple/

腾讯源
pip install xxxx -i http://mirrors.cloud.tencent.com/pypi/simple

豆瓣源
pip install xxxx -i http://pypi.douban.com/simple/

中科院源
pip install xxxx -i https://pypi.mirrors.ustc.edu.cn/simple/
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14

只需要把xxxx换成自己需要安装的包的名字。

永久换源

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

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

腾讯源
pip config set global.index-url http://mirrors.cloud.tencent.com/pypi/simple

豆瓣源
pip config set global.index-url http://pypi.douban.com/simple/

中科院源
pip config set global.index-url https://pypi.mirrors.ustc.edu.cn/simple/
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14

换回默认源

pip config unset global.index-url
  • 1

辅助网站

清华大学开源软件镜像站
腾讯软件源
阿里巴巴开源镜像站
中国科学技术大学开源软件镜像站

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小桥流水78/article/detail/894711
推荐阅读
相关标签
  

闽ICP备14008679号