pip镜像设置

2017-08-10  本文已影响76人  逑熙

pip配置在linux默认的路径是
$HOME/.pip/pip.conf
在windows默认的路径是
%HOME%\pip\pip.ini

默认路径下并不存在配置文件,需要新建,然后在配置文件中写入:
[global]
index-url = http://pypi.mirrors.ustc.edu.cn/simple/

中国的PyPI镜像源,最上方的源在我这访问速度最快,速度依次向下递减,所以试一试前几个就好了。
阿里云 http://mirrors.aliyun.com/pypi/simple/
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
豆瓣(douban) 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/

二、如何使用镜像源
使用镜像源很简单,用-i指定就行了,例如:

sudo easy_install -i http://pypi.douban.com/simple saltTesting
sudo pip install -i http://pypi.douban.com/simple saltTesting
上一篇下一篇

猜你喜欢

热点阅读