國內(nèi)源推薦
新版ubuntu要求使用https源拯刁,要注意
清華:https://pypi.tuna.tsinghua.edu.cn/simple
阿里云:http://mirrors.aliyun.com/pypi/simple/
中國科技大學(xué) https://pypi.mirrors.ustc.edu.cn/simple/
華中理工大學(xué):http://pypi.hustunique.com/
山東理工大學(xué):http://pypi.sdutlinux.org/
豆瓣:http://pypi.douban.com/simple/
臨時使用法
可以在使用 pip 的時候加參數(shù) -i https://pypi.tuna.tsinghua.edu.cn/simple
示例:pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pyspider
一勞永逸法
Linux 下田藐,修改 ~/.pip/pip.conf (沒有就創(chuàng)建一個文件夾及文件。文件夾要加“.”夯膀,表示是隱藏文件夾)
內(nèi)容如下:
[global]
timeout = 6000
index-url = http://pypi.douban.com/simple/
[install]
use-mirrors = true
mirrors = http://pypi.douban.com/simple/
trusted-host = pypi.douban.com
Windows下,直接在user目錄中創(chuàng)建一個pip目錄,如:C:\Users\xx\pip弦疮,新建文件pip.ini,內(nèi)容同上蜘醋。