前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >专栏 >Python 更换国内pip源

Python 更换国内pip源

作者头像
全栈程序员站长
发布于 2022-09-06 01:47:00
发布于 2022-09-06 01:47:00
1.6K0
举报

大家好,又见面了,我是你们的朋友全栈君。

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

– 中科大:https://pypi.mirrors.ustc.edu.cn/simple/

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

一次性使用

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

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

永久修改,一劳永逸:

  • linux下,修改 ~/.pip/pip.conf (没有就创建一个), 修改 index-url 为国内镜像地址,内容如下: [global] index-url = https://pypi.tuna.tsinghua.edu.cn/simple
  • windows下,直接在user目录中创建一个pip目录,如:C:\Users\xx\pip,新建文件pip.ini,内容如下 [global] index-url = https://pypi.tuna.tsinghua.edu.cn/simple

发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/136227.html原文链接:https://javaforall.cn

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2022年6月3,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • – 豆瓣:http://pypi.douban.com/simple/
  • – 中科大:https://pypi.mirrors.ustc.edu.cn/simple/
  • – 清华:https://pypi.tuna.tsinghua.edu.cn/simple
  • 一次性使用
  • 永久修改,一劳永逸:
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档