ICode9

精准搜索请尝试: 精确搜索
首页 > 系统相关> 文章详细

Linux_pip3安装包超时:pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='file

2022-04-29 15:31:16  阅读:346  来源: 互联网

标签:files HTTPSConnectionPool py python3.6 usr File pip line 安装包


pip3 install django

报错如下:

Collecting django
Downloading https://files.pythonhosted.org/packages/c3/68/b63abc009adee25c1bd266b3740e173eab656608cf21641594a37e02cf57/Django-3.2.13-py3-none-any.whl (7.9MB)
5% |?? | 471kB 9.7kB/s eta 0:12:42Exception:
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/pip/_vendor/urllib3/response.py", line 302, in _error_catcher
yield
File "/usr/lib/python3.6/site-packages/pip/_vendor/urllib3/response.py", line 384, in read
data = self._fp.read(amt)
File "/usr/lib/python3.6/site-packages/pip/_vendor/cachecontrol/filewrapper.py", line 60, in read
data = self.__fp.read(amt)
File "/usr/lib64/python3.6/http/client.py", line 459, in read
n = self.readinto(b)
File "/usr/lib64/python3.6/http/client.py", line 503, in readinto
n = self.fp.readinto(b)
File "/usr/lib64/python3.6/socket.py", line 586, in readinto
return self._sock.recv_into(b)
File "/usr/lib64/python3.6/ssl.py", line 971, in recv_into
return self.read(nbytes, buffer)
File "/usr/lib64/python3.6/ssl.py", line 833, in read
return self._sslobj.read(len, buffer)
File "/usr/lib64/python3.6/ssl.py", line 590, in read
v = self._sslobj.read(len, buffer)
socket.timeout: The read operation timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/usr/lib/python3.6/site-packages/pip/commands/install.py", line 346, in run
requirement_set.prepare_files(finder)
File "/usr/lib/python3.6/site-packages/pip/req/req_set.py", line 381, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/usr/lib/python3.6/site-packages/pip/req/req_set.py", line 623, in _prepare_file
session=self.session, hashes=hashes)
File "/usr/lib/python3.6/site-packages/pip/download.py", line 821, in unpack_url
hashes=hashes
File "/usr/lib/python3.6/site-packages/pip/download.py", line 659, in unpack_http_url
hashes)
File "/usr/lib/python3.6/site-packages/pip/download.py", line 882, in _download_http_url
_download_url(resp, link, content_file, hashes)
File "/usr/lib/python3.6/site-packages/pip/download.py", line 603, in _download_url
hashes.check_against_chunks(downloaded_chunks)
File "/usr/lib/python3.6/site-packages/pip/utils/hashes.py", line 46, in check_against_chunks
for chunk in chunks:
File "/usr/lib/python3.6/site-packages/pip/download.py", line 571, in written_chunks
for chunk in chunks:
File "/usr/lib/python3.6/site-packages/pip/utils/ui.py", line 139, in iter
for x in it:
File "/usr/lib/python3.6/site-packages/pip/download.py", line 560, in resp_read
decode_content=False):
File "/usr/lib/python3.6/site-packages/pip/_vendor/urllib3/response.py", line 436, in stream
data = self.read(amt=amt, decode_content=decode_content)
File "/usr/lib/python3.6/site-packages/pip/_vendor/urllib3/response.py", line 401, in read
raise IncompleteRead(self._fp_bytes_read, self.length_remaining)
File "/usr/lib64/python3.6/contextlib.py", line 99, in __exit__
self.gen.throw(type, value, traceback)
File "/usr/lib/python3.6/site-packages/pip/_vendor/urllib3/response.py", line 307, in _error_catcher
raise ReadTimeoutError(self._pool, None, 'Read timed out.')
pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.

 

 

超时了,可通过延长超时时间的方法解决此问题

pip3 --default-timeout=1000 install -U django

 

标签:files,HTTPSConnectionPool,py,python3.6,usr,File,pip,line,安装包
来源: https://www.cnblogs.com/rychh/p/16206842.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有