Python 解决 pip 下载慢 使用国内源教程

国内源

清华:https://pypi.tuna.tsinghua.edu.cn/simple

Python 解决 pip 下载慢 使用国内源教程

阿里云:https://mirrors.aliyun.com/pypi/simple/

中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/

华中理工大学:http://pypi.hustunique.com/

山东理工大学:http://pypi.sdutlinux.org/

豆瓣:http://pypi.douban.com/simple/

临时使用:

可以在使用 pip 的时候加参数 -i https://pypi.tuna.tsinghua.edu.cn/simple

例如:pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pyspider,这样就会从清华这边的镜像去安装 pyspider 库。

永久修改,一劳永逸:

Linux 下,修改 ~/.pip/pip.conf (没有就创建一个文件夹及文件。文件夹要加“.”,表示是隐藏文件夹)

内容如下:

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

windows 下,直接在 user 目录中创建一个 pip 目录,如:C:\Users\xx\pip,新建文件 pip.ini。内容同上。

目录
  • 国内源
  • 临时使用:
  • 永久修改,一劳永逸:
  • 目录
  • 国内源
  • 临时使用:
  • 永久修改,一劳永逸:
  • 手机扫描二维码访问

      本文标题:《Python 解决 pip 下载慢 使用国内源教程》作者:极四维博客
      原文链接:https://cway.top/post/831.html
      特别注明外均为原创,转载请注明。

      分享到微信

      扫描二维码

      可在微信查看或分享至朋友圈。

      相关文章

      发表评论:

      ◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

      «    2025年5月    »
      1234
      567891011
      12131415161718
      19202122232425
      262728293031

      搜索

      控制面板

      您好,欢迎到访网站!
        查看权限

      最新留言

      文章归档

      • 订阅本站的 RSS 2.0 新闻聚合