pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org',
我就想说,这破问题搞了我快两个下午了,网上各种方法读试过了,不行!!!
Error occurred:
pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.
Proposed solution:
Try to run this command from the system terminal. Make sure that you use the correct version of 'pip' installed for your Python interpreter located at 'D:\Maindocument\pycharmDemo\venv\Scripts\python.exe'.
Command output:
Collecting Pygame
Downloading https://files.pythonhosted.org/packages/45/34/38e7465c1aea7d570b83d9004eb0c4e783c9c1b17eb9eeb9a760c0898783/pygame-1.9.4-cp36-cp36m-win_amd64.whl (4.2MB)
最后我快要放弃的时候,突然想到,你不是说超时了吗,既然你下载这么慢,我试试手机开热点,
结果秒成功,简直是无语!
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=15)",)': /packages/45/34/38e7465c1aea7d570b83d9004eb0c4e783c9c1b17eb9eeb9a760c0898783/pygame-1.9.4-cp36-cp36m-win_amd64.whl
Exception:
Traceback (most recent call last):
File "D:\Maindocument\pycharmDemo\venv\lib\site-packages\pip\_vendor\urllib3\response.py", line 331, in _error_catcher
yield
File "D:\Maindocument\pycharmDemo\venv\lib\site-packages\pip\_vendor\urllib3\response.py", line 413, in read
data = self._fp.read(amt)
File "D:\Maindocument\pycharmDemo\venv\lib\site-packages\pip\_vendor\cachecontrol\filewrapper.py", line 62, in read
data = self.__fp.read(amt)
File "C:\Users\鑫仔\AppData\Local\Programs\Python\Python36\lib\http\client.py", line 449, in read
n = self.readinto(b)
File "C:\Users\鑫仔\AppData\Local\Programs\Python\Python36\lib\http\client.py", line 493, in readinto
n = self.fp.readinto(b)
File "C:\Users\鑫仔\AppData\Local\Programs\Python\Python36\lib\socket.py", line 586, in readinto
return self._sock.recv_into(b)
File "C:\Users\鑫仔\AppData\Local\Programs\Python\Python36\lib\ssl.py", line 1009, in recv_into
return self.read(nbytes, buffer)
File "C:\Users\鑫仔\AppData\Local\Programs\Python\Python36\lib\ssl.py", line 871, in read
return self._sslobj.read(len, buffer)
File "C:\Users\鑫仔\AppData\Local\Programs\Python\Python36\lib\ssl.py", line 631, 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 "D:\Maindocument\pycharmDemo\venv\lib\site-packages\pip\_internal\basecommand.py", line 141, in main
status = self.run(options, args)
File "D:\Maindocument\pycharmDemo\venv\lib\site-packages\pip\_internal\commands\install.py", line 299, in run
resolver.resolve(requirement_set)
File "D:\Maindocument\pycharmDemo\venv\lib\site-packages\pip\_internal\resolve.py", line 102, in resolve
self._resolve_one(requirement_set, req)
File "D:\Maindocument\pycharmDemo\venv\lib\site-packages\pip\_internal\resolve.py", line 256, in _resolve_one
abstract_dist = self._get_abstract_dist_for(req_to_install)
File "D:\Maindocument\pycharmDemo\venv\lib\site-packages\pip\_internal\resolve.py", line 209, in _get_abstract_dist_for
self.require_hashes
File "D:\Maindocument\pycharmDemo\venv\lib\site-packages\pip\_internal\operations\prepare.py", line 283, in prepare_linked_requirement
progress_bar=self.progress_bar
File "D:\Maindocument\pycharmDemo\venv\lib\site-packages\pip\_internal\download.py", line 836, in unpack_url
progress_bar=progress_bar
File "D:\Maindocument\pycharmDemo\venv\lib\site-packages\pip\_internal\download.py", line 673, in unpack_http_url
progress_bar)
File "D:\Maindocument\pycharmDemo\venv\lib\site-packages\pip\_internal\download.py", line 897, in _download_http_url
_download_url(resp, link, content_file, hashes, progress_bar)
File "D:\Maindocument\pycharmDemo\venv\lib\site-packages\pip\_internal\download.py", line 617, in _download_url
hashes.check_against_chunks(downloaded_chunks)
File "D:\Maindocument\pycharmDemo\venv\lib\site-packages\pip\_internal\utils\hashes.py", line 48, in check_against_chunks
for chunk in chunks:
File "D:\Maindocument\pycharmDemo\venv\lib\site-packages\pip\_internal\download.py", line 585, in written_chunks
for chunk in chunks:
File "D:\Maindocument\pycharmDemo\venv\lib\site-packages\pip\_internal\utils\ui.py", line 159, in iter
for x in it:
File "D:\Maindocument\pycharmDemo\venv\lib\site-packages\pip\_internal\download.py", line 574, in resp_read
decode_content=False):
File "D:\Maindocument\pycharmDemo\venv\lib\site-packages\pip\_vendor\urllib3\response.py", line 465, in stream
data = self.read(amt=amt, decode_content=decode_content)
File "D:\Maindocument\pycharmDemo\venv\lib\site-packages\pip\_vendor\urllib3\response.py", line 430, in read
raise IncompleteRead(self._fp_bytes_read, self.length_remaining)
File "C:\Users\鑫仔\AppData\Local\Programs\Python\Python36\lib\contextlib.py", line 99, in __exit__
self.gen.throw(type, value, traceback)
File "D:\Maindocument\pycharmDemo\venv\lib\site-packages\pip\_vendor\urllib3\response.py", line 336, 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.