Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
Fresh Python 3.7 64-bit install downloaded from their main website, working on Windows 10 Pro. Using PowerShell with Admin rights.
Pip always throws ReadTimeoutError
.
The command:
python -m pip -vvv install --upgrade pip
Returns the following:
Config variable 'Py_DEBUG' is unset, Python ABI tag may be incorrect
Config variable 'WITH_PYMALLOC' is unset, Python ABI tag may be
incorrect Created temporary directory:
C:\Users\vbfal\AppData\Local\Temp\pip-ephem-wheel-cache-sotpqqgg
Created temporary directory:
C:\Users\vbfal\AppData\Local\Temp\pip-install-qqmlc7qa 1 location(s)
to search for versions of pip:
*
https://pypi.org/simple/pip/
Getting page
https://pypi.org/simple/pip/
Looking up "
https://pypi.org/simple/pip/
"
in the cache No cache entry available Starting new HTTPS connection
(1): pypi.org Incremented Retry for (url='/simple/pip/'):
Retry(total=4, connect=None, read=None, redirect=None, status=None)
Retrying (Retry(total=4, connect=None, read=None, redirect=None,
status=None)) after connection broken by
'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443):
Read timed out. (read timeout=15)")': /simple/pip/ Starting new HTTPS
connection (2): pypi.org Incremented Retry for (url='/simple/pip/'):
Retry(total=3, connect=None, read=None, redirect=None, status=None)
Retrying (Retry(total=3, connect=None, read=None, redirect=None,
status=None)) after connection broken by
'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443):
Read timed out. (read timeout=15)")': /simple/pip/ Starting new HTTPS
connection (3): pypi.org Incremented Retry for (url='/simple/pip/'):
Retry(total=2, connect=None, read=None, redirect=None, status=None)
Retrying (Retry(total=2, connect=None, read=None, redirect=None,
status=None)) after connection broken by
'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443):
Read timed out. (read timeout=15)")': /simple/pip/ Starting new HTTPS
connection (4): pypi.org Incremented Retry for (url='/simple/pip/'):
Retry(total=1, connect=None, read=None, redirect=None, status=None)
Retrying (Retry(total=1, connect=None, read=None, redirect=None,
status=None)) after connection broken by
'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443):
Read timed out. (read timeout=15)")': /simple/pip/ Starting new HTTPS
connection (5): pypi.org Incremented Retry for (url='/simple/pip/'):
Retry(total=0, connect=None, read=None, redirect=None, status=None)
Retrying (Retry(total=0, connect=None, read=None, redirect=None,
status=None)) after connection broken by
'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443):
Read timed out. (read timeout=15)")': /simple/pip/ Starting new HTTPS
connection (6): pypi.org Could not fetch URL
https://pypi.org/simple/pip/
: connection error:
HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded
with url: /simple/pip/ (Caused by
ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read
timed out. (read timeout=15)")) - skipping Installed version (10.0.1)
is most up-to-date (past versions: none) Requirement already
up-to-date: pip in c:\program files\python37\lib\site-packages
(10.0.1) Cleaning up... Config variable 'Py_DEBUG' is unset, Python
ABI tag may be incorrect Config variable 'WITH_PYMALLOC' is unset,
Python ABI tag may be incorrect 1 location(s) to search for versions
of pip:
*
https://pypi.org/simple/pip/
Getting page
https://pypi.org/simple/pip/
Looking up "
https://pypi.org/simple/pip/
"
in the cache No cache entry available Starting new HTTPS connection
(1): pypi.org Could not fetch URL
https://pypi.org/simple/pip/
:
connection error: HTTPSConnectionPool(host='pypi.org', port=443): Max
retries exceeded with url: /simple/pip/ (Caused by
ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read
timed out. (read timeout=5)")) - skipping
I tried pinging pypi and it seemed ok:
Pinging pypi.org [151.101.64.223] with 32 bytes of data: Reply from
151.101.64.223: bytes=32 time=12ms TTL=57 Reply from 151.101.64.223: bytes=32 time=25ms TTL=57 Reply from 151.101.64.223: bytes=32
time=17ms TTL=57 Reply from 151.101.64.223: bytes=32 time=211ms TTL=57
Ping statistics for 151.101.64.223:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds:
Minimum = 12ms, Maximum = 211ms, Average = 66ms
At first curl to pypi.org seemed to hint at the root cause, returning:
curl : The request was aborted: Could not create SSL/TLS secure
channel. At line:1 char:1
+ curl pypi.org
+ ~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest],
WebException
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
I ran the following to force curl to use TLS 1.2:
[Net.ServicePointManager]::SecurityProtocol = "tls12, tls11, tls"
Which then makes curl work (for the session only) returning status 200.
But alas, pip keeps throwing the exact same error message above. I have also tried increasing timeout range to 100 or even to 1000, as suggested in other posts, because, well, Windows... but as expected it only took longer to fail.
Can anyone help me decipher and fix these, please? Thanks a lot!
(Switching to Linux not an option at this time...)
–
–
I know this is an old post, but trying to help however is having the same problem.
Fixed this issue by changing the priority from IPv6 to IPv4.
You can try temporarily disable the IPv6 protocol, then try PIP again. If it works, i recommend reactivating IPv6 then searching about IPv4 priority over IPv6, the way to do it changes depending of OS.
–
Give precedence to IPv4 over IPv6 (as Lin Chi Yu wrote).
From an elevated command prompt (press "Start", type "CMD", right click on "Command prompt" and select "Run as Administrator"):
netsh interface ipv6 set prefixpolicy ::ffff:0:0/96 46 4
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.