- pip-修改国内镜像源
- Oct 10, 2016 | 16 Hits
- mkdir ~/.pip
- vim ~/.pip/pip.conf
- [global]
- index-url = http://mirrors.aliyun.com/pypi/simple/
- [install]
- trusted-host = mirrors.aliyun.com
- 注意事项:
-
- http://mirrors.aliyun.com/pypi/simple/ 中的simple目录必须有。
- –no-cache-dir 重新下载安装包,而不是使用缓存包。
- trusted-host = mirrors.aliyun.com 一定要加上这行,否则会报错。
- pip国内镜像源
-
- 阿里云 http://mirrors.aliyun.com/pypi/simple/
- 中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
- 豆瓣 http://pypi.douban.com/simple
- Python官方 https://pypi.python.org/simple/
- v2ex http://pypi.v2ex.com/simple/
- 中国科学院 http://pypi.mirrors.opencas.cn/simple/
- 清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/
-
- 报错汇总
-
- 报错内容
-
- pip install mysql-python
- Collecting mysql-python
- 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'.
- Could not find a version that satisfies the requirement mysql-python (from versions: )
- No matching distribution found for mysql-python
- 解决办法
-
- 编辑 vim .pip/pip.conf
-
- [install]
- trusted-host = mirrors.aliyun.com
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/91975/viewspace-2142908/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/91975/viewspace-2142908/