在 /etc/pip.conf 添加如下內容,啟用源
[global]
extra-index-url=https://www.piwheels.org/simple
下載后 pip install **.whl 安裝
國內源:
新版ubuntu要求使用https源,要注意。
清華:https://pypi.tuna.tsinghua.edu.cn/simple
阿里雲:http://mirrors.aliyun.com/pypi/simple/
中國科技大學 https://pypi.mirrors.ustc.edu.cn/simple/
華中理工大學:http://pypi.hustunique.com/
山東理工大學:http://pypi.sdutlinux.org/
豆瓣:http://pypi.douban.com/simple/
臨時使用:
可以在使用pip的時候加參數-i https://pypi.tuna.tsinghua.edu.cn/simple
例如:pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pyspider,這樣就會從清華這邊的鏡像去安裝pyspider庫
修改 /etc/pip.conf
內容如下:
[global]
extra-index-url=http://mirrors.aliyun.com/pypi/simple
[install] trusted-host=mirrors.aliyun.com
