對于國內來說,用默認的源是在速度太慢了,每秒就幾kb,
修改源,首先需要創建配置文件,路徑如下:
linux和macos:
~/.pip/pip.conf
windows :
%userprofile%\pip\pip.ini(C:\Users\Corek\pip\pip.ini)
我win10和macos和ubuntu環境都配置過:
以下ubuntu為例,除了配置文件路徑不同,內容都是一行的
具體操作
cd ~
mkdir .pip
vi .pip/pip.conf
輸入一下內容,保存并退出就好了
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
trusted-host = pypi.tuna.tsinghua.edu.cn
屏幕快照 2016-06-29 下午4.41.58.png
超級快吧。
===附上easy_install修改源方法,我沒測試過==
easy_install的添加方法:
創建配置文件:
Windows下是在: ~\pydistutils.cfg
Linux下是在: $HOME/.pydistutils.cfg
內容
[easy_install]
index-url=http://pypi.douban.com/simple