2020-09-03解决pip install安装非常慢[Errno 101] 网络不可达问题
生活随笔
收集整理的這篇文章主要介紹了
2020-09-03解决pip install安装非常慢[Errno 101] 网络不可达问题
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
轉(zhuǎn)載鏈接:http://huanyouchen.github.io/2019/11/21/pip-install-package-very-slow/
問題描述
使用pip安裝seaborn提示:
| sudo python3.5 -m pip install seabornCollecting seabornWARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fb25d444fd0>: Failed to establish a new connection: [Errno 101] 網(wǎng)絡(luò)不可達',)': /packages/a8/76/220ba4420459d9c4c9c9587c6ce607bf56c25b3d3d2de62056efe482dadc/seaborn-0.9.0-py3-none-any.whl |
嘗試加入default-time=100這個參數(shù),提示:
| sudo python3.5 -m pip --default-time=100 install seabornCollecting seabornWARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out. (read timeout=100.0)",)': /packages/a8/76/220ba4420459d9c4c9c9587c6ce607bf56c25b3d3d2de62056efe482dadc/seaborn-0.9.0-py3-none-any.whl |
?
等了半天還是安裝不了
解決方法
在pip后面加入-i參數(shù),比如:-i?https://pypi.tuna.tsinghua.edu.cn/simple
| sudo python3.5 -m pip --default-time=100 install seaborn -i https://pypi.tuna.tsinghua.edu.cn/s |
另外,可以將默認時間延遲增大避免超時
--default-timeout=10000 -i?https://pypi.tuna.tsinghua.edu.cn/simple
pip install tensorflow --default-timeout=10000 -i https://pypi.doubanio.com/simple/?
下載的飛快~
據(jù)說可以一勞永逸的方法,但我還沒試過,過程如下:
| mkdir ~/.pip cd ~/.pip touch pip.conf gedit pip.conf[global] index-url = http://pypi.douban.com/simple [install] trusted-host = pypi.douban.comcat pip.conf |
總結(jié)
以上是生活随笔為你收集整理的2020-09-03解决pip install安装非常慢[Errno 101] 网络不可达问题的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: java中undefined如何解决_处
- 下一篇: 频率域滤波