pip: error when use pipWARNING: 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/colorama/
- pip version:19.2.3
- Python version:3.7.6
- OS:Windows 10 home
I was trying to install colorama I tried delete and install other versions of python and nothing helped
Output
Collecting colorama
WARNING: 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/colorama/
WARNING: 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/colorama/
WARNING: 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/colorama/
WARNING: 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/colorama/
WARNING: 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/colorama/
ERROR: Could not find a version that satisfies the requirement colorama (from versions: none)
ERROR: No matching distribution found for colorama
in pycharm the same problem with install package
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 5
- Comments: 34 (1 by maintainers)
First, this is also seem to be the same as #9487, so linking it here.
Second, @liron50 - open the HOSTS file, which is located at
C:\Windows\System32\Drivers\etc
, in notepad running as Administrator. Than just add 2 lines at the end:Rerun the pip command and everything should work. If anyone trying this workaround, please also check that the DNS resolves to IPv6 address, and if note, write it here.
Note: this method is a workaround only. You should NOT use this method as a constant solution.
Same here, and it also for #9489.
From what I tested, it seem to be something with IPv6. When I ran
ping pypi.org
I got a lot of timeouts:But when forcing IPv4, no problem:
So I added
151.101.0.223 pypi.org
to theHOSTS
file and tested again:Now seem as the issue is with the file server (
files.pythonhosted.org
) so I added it too (151.101.1.63 files.pythonhosted.org
) and now everything works:BTW, I’m with python 3.8.5 on Windows 10 Pro and pip version 21.0.
on Windows 10 just uncheck TCP/IPv6
Control panel -> Network and sharing Center -> Change adapter settings -> right click on your current connection (WiFi or LAN) and choose “Properties” -> Uncheck the box with TCP/IPv6
Worked for me!! Thanks!
DjLegolas , Can you share the instructions for fixing it? how do I add 151.101.0.223 pypi.org to the HOSTS file/files.pythonhosted.org? where can I fine the relevant files?
thanks