python pip安装第三方库超时问题(raise ReadTimeoutError(self._pool, None, “Read timed out.“)
不得不吐槽,有時候家里的網速,簡直感人。。分分鐘就掉眼淚,在命令行終端想下載jupyter
pip install jupyter一直timeout!
raise ReadTimeoutError(self._pool, None, “Read timed out.”)
pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host=‘files.pythonhosted.org’, port=443): Read timed out.
嘗試了N次之后,不得不尋求其他途徑,自然而然就想到了像一些安裝軟件常用的使用國內鏡像一樣,于是讓我找到了,安裝源,網速好的童鞋就直接pip install jupyter就好啦(羨慕別人家的孩紙┭┮﹏┭┮)
以下介紹了三種解決方案,自行選擇,我用了第二種方案解決了
首先你先要有pip工具,至于怎么安裝自行百度哦
pip下載超時處理
aise ReadTimeoutError(self._pool, None, ‘Read timed out.’)
方案一:對于比較小的庫,可以延時處理
-------- pip --default-timeout=100 install -U pip
-------- pip --default-timeout=100 install 第三方庫名
方案二:更換安裝源
------------網上可以查找很多豆瓣源
如https://pypi.tuna.tsinghua.edu.cn/simple/
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pyecharts
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple 庫名
比如,安裝jupyter
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple jupyter發現下載速度真的是快了好多!太贊了!
終于可以打開 jupyter notebook了,開心~下載這個折磨了我整整一下午的時間還不止啊
出錯使用這種 :pip install --index-url https://pypi.tuna.tsinghua.edu.cn/simple/ lightgbm
附上常用的鏡像地址
清華: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 install -i https://pypi.tuna.tsinghua.edu.cn/simple scrapy
方案三:下載離線包
python所有庫:(https://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml)
---------然后通過pip install 保存路徑/加上下載的文件名 進行安裝
(如pip install C:\Users\HP\Desktop\scikit_image-0.14.1-cp37-cp37m-win32.whl)
總結
以上是生活随笔為你收集整理的python pip安装第三方库超时问题(raise ReadTimeoutError(self._pool, None, “Read timed out.“)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 模拟登录123026网站
- 下一篇: 搜索背景