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

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/91975/viewspace-2142908/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/91975/viewspace-2142908/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值