目錄:
1、更多下載源
2、下載過慢
清華: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/
方法:切換下載源
例如:下載第三方庫tensorflow-gpu時,在后面加上 -i 加上上面的任一個網站,命令如下:
pip install tensorflow-gpu -i https://pypi.tuna.tsinghua.edu.cn/simple/
注意:新版本的pip需要將pip換成pip3命令。
(1)可以切換下載源詳見 2、下載過慢;(如果問題還是無法解決請看方法(2))
(2)設置默認超時時間
在原命令后面加上 --default-timeout=xxx (xxx表示時間),命令如(依舊以第三方庫tensorflow-gpu為例):
pip install tensorflow-gpu -i https://pypi.tuna.tsinghua.edu.cn/simple/ --default-timeout=1000
本博客參考:
pip inistall xxx超時解決方案 https://blog.csdn.net/Stray_Lambs/article/details/102248702