pip换源
国内源
- 清华源:https://pypi.tuna.tsinghua.edu.cn/simple
- 阿里源:https://mirrors.aliyun.com/pypi/simple/
- 腾讯源:http://mirrors.cloud.tencent.com/pypi/simple
- 豆瓣源:http://pypi.douban.com/simple/
- 中科大:https://mirrors.bfsu.edu.cn/pypi/web/simple/
我个人推荐清华源,日常使用没有问题。
操作流程
- Linux或macos操作流程
mkdir ~/.pip # 如果没有.pip文件夹,则创建一个 cd ~/.pip vim pip.conf
2 . 输入内容
[global] index-url = https://pypi.tuna.tsinghua.edu.cn/simple extra-index-url = https://mirrors.aliyun.com/pypi/simple [install] trusted-host = https://pypi.tuna.tsinghua.edu.cn # trusted-host 保留一个就可以了 # trusted-host = https://mirrors.aliyun.com/pypi/simple
直接进行修改进行了。extra-index-url是指额外的源,同时匹配多个源。
trusted-host就是网址除子页面的部分,如https://pypi.tuna.tsinghua.edu.cn。
查看镜像
pip config list
参考文档:
本文作者:顾子郤
本文链接:https://www.cnblogs.com/coder-shane/p/18120239
版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构