温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

Python中怎么修改pip源

发布时间:2021-07-10 17:05:02 来源:亿速云 阅读:128 作者:Leah 栏目:编程语言

Python中怎么修改pip源,很多新手对此不是很清楚,为了帮助大家解决这个难题,下面小编将为大家详细讲解,有这方面需求的人可以来学习下,希望你能有所收获。


  1. pip-修改国内镜像源

  2. Oct 10, 2016 | 16 Hits

  3. mkdir ~/.pip

  4. vim ~/.pip/pip.conf

  5. [global]

  6. index-url = http://mirrors.aliyun.com/pypi/simple/

  7. [install]

  8. trusted-host = mirrors.aliyun.com

  9. 注意事项:


  10. http://mirrors.aliyun.com/pypi/simple/ 中的simple目录必须有。

  11. –no-cache-dir 重新下载安装包,而不是使用缓存包。

  12. trusted-host = mirrors.aliyun.com 一定要加上这行,否则会报错。

  13. pip国内镜像源


  14. 阿里云 http://mirrors.aliyun.com/pypi/simple/

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

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

  17. Python官方 https://pypi.python.org/simple/

  18. v2ex http://pypi.v2ex.com/simple/

  19. 中国科学院 http://pypi.mirrors.opencas.cn/simple/

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


  21. 报错汇总


  22. 报错内容


  23. pip install mysql-python

  24. Collecting mysql-python

  25.   The repository located at pypi.douban.com is not a trusted or secure host and is being ignored. If this repository is available via HTTPS it is recommended to use HTTPS instead, otherwise you may silence this warning and allow it anyways with '--trusted-host pypi.douban.com'.

  26.   Could not find a version that satisfies the requirement mysql-python (from versions: )

  27. No matching distribution found for mysql-python

  28. 解决办法


  29. 编辑 vim .pip/pip.conf


  30. [install]

  31. trusted-host = mirrors.aliyun.com

看完上述内容是否对您有帮助呢?如果还想对相关知识有进一步的了解或阅读更多相关文章,请关注亿速云行业资讯频道,感谢您对亿速云的支持。

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI