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/

See original GitHub issue
  • 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

image

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:5
  • Comments:34 (1 by maintainers)

github_iconTop GitHub Comments

58reactions
DjLegolascommented, Jan 26, 2021

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:

151.101.0.223 pypi.org
151.101.1.63 files.pythonhosted.org

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.

23reactions
DjLegolascommented, Jan 25, 2021

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:

ping pypi.org

Pinging pypi.org [2a04:4e42::223] with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.

Ping statistics for 2a04:4e42::223:
    Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),

But when forcing IPv4, no problem:

ping -4 pypi.org

Pinging pypi.org [151.101.0.223] with 32 bytes of data:
Reply from 151.101.0.223: bytes=32 time=88ms TTL=51
Reply from 151.101.0.223: bytes=32 time=89ms TTL=51
Reply from 151.101.0.223: bytes=32 time=89ms TTL=51
Reply from 151.101.0.223: bytes=32 time=88ms TTL=51

Ping statistics for 151.101.0.223:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 88ms, Maximum = 89ms, Average = 88ms

So I added 151.101.0.223 pypi.org to the HOSTS file and tested again:

py -3 -m pip install -U pip
Requirement already satisfied: pip in c:\python38\lib\site-packages (21.0)
Collecting pip
  WARNING: 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/de/47/58b9f3e6f611dfd17fb8bd9ed3e6f93b7ee662fb85bdfee3565e8979ddf7
/pip-21.0-py3-none-any.whl
  WARNING: Retrying (Retry(total=3, 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/de/47/58b9f3e6f611dfd17fb8bd9ed3e6f93b7ee662fb85bdfee3565e8979ddf7
/pip-21.0-py3-none-any.whl
ERROR: Operation cancelled by user

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:

py -3 -m pip install -U pip
Requirement already satisfied: pip in c:\python38\lib\site-packages (21.0)
Collecting pip
  Downloading pip-21.0-py3-none-any.whl (1.5 MB)
     |████████████████████████████████| 1.5 MB 1.1 MB/s
  Downloading pip-20.3.4-py2.py3-none-any.whl (1.5 MB)
     |████████████████████████████████| 1.5 MB ...

BTW, I’m with python 3.8.5 on Windows 10 Pro and pip version 21.0.

Read more comments on GitHub >

github_iconTop Results From Across the Web

HTTPSConnectionPool(host='pypi.python.org', port=443) with ...
I cannot find the setting with pip help or pip install help . There is howerver socket timeout . I wonder what is...
Read more >
WARNING: pip is configured with locations that require TLS ...
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect ...
Read more >
Redash install fail on pip - Support
(read timeout=15)")': /simple/flask/ WARNING: Retrying (Retry(total=3 ... read=None, redirect=None, status=None)) after connection broken by ...
Read more >
用pip安装包时提示超时错误WARNING: Retrying (Retry(total=4 ...
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by ...
Read more >
pygame安装问题- 腾讯云开发者社区
(connect timeout=15)')': /simple/pip/ WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found