Skip to content

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/ #9508

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Edgardbu opened this issue Jan 24, 2021 · 34 comments
Labels
type: support User Support

Comments

@Edgardbu
Copy link

  • 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

@nstylepro
Copy link

same for me.

@DjLegolas
Copy link

DjLegolas commented 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.

@liron50
Copy link

liron50 commented Jan 26, 2021

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

@DjLegolas
Copy link

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.

@liron50
Copy link

liron50 commented Jan 27, 2021

Thanks DjLegolas.
It does worked for me.

@attiqRahman
Copy link

Thanks mate ! it works!

@DjLegolas
Copy link

After some more investigation (thanks to tos9 from the IRC), there seem to be something with the routing to both sites on the users side.
But even though tos9 thinks this is the place to drop it, I think the pip code is also to be blamed.

for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):

This line gets host='pypi.org' and family=socket.AF_UNSPEC, which returns always a list of tuples ordered by IPv6 first and only after that IPv4.
But even though there is a problem communicating over IPv6, a socket is successfully created.
And only later, when trying to wrap the socket with SSL, we get the timeout exception:
self.sock = ssl_wrap_socket(

Any ideas and/or suggestions?

@Tros-t
Copy link

Tros-t commented Feb 2, 2021

I have recieved this error 5 to 6 times, in total spend 19hours trying to fix this from over 7 stack overflows, 4 githubs, 4 more websites no HELP. And Sorry to say @DjLegolas it is not working. I am sooooooo Done. My main device is a windows 7 and it sucks but there is another device a win 10 it's ok but I can't use it because all my work is stored in win7.

IF any more solutions tell me. Whats happening here is I don't use proxy servers or something like that and I have it turned off. Whenever I try pip install the proxy turns on automatically. You can answer on my stackoverflow question or here but pls ANSWER anyone

@Tros-t
Copy link

Tros-t commented Feb 2, 2021

@Tros-t
Copy link

Tros-t commented Feb 2, 2021

Ahahahahaha I reinstalled python and it worked also the I was unchecking proxy but I wasn't applying it.

For everyone who has this error never upgrade pip

@Tros-t
Copy link

Tros-t commented Feb 2, 2021

I installed all packages needed without upgrading pip. Hope this gets fixed

@Reiterkk
Copy link

Reiterkk commented Feb 3, 2021

I have a similar problem and nothing mentioned here worked. I can't install anything with pip install.

  • pip version: 20.2.3
  • Python version: 3.9.1 64 bit
  • OS: Windows 10 Enterprise

I've also tried other versions of python. Adding

151.101.0.223 pypi.org
151.101.1.63 files.pythonhosted.org

to the hosts file didn't work either. The error I get is not a ReadTimeoutError but a ConnectTimeoutError.

pip_error_01

Increasing the timeout was not successful as well, instead I get a NewConnectionError

pip_error_02

Any suggestions what else to try?

@Tros-t
Copy link

Tros-t commented Feb 3, 2021

Hmm I am trying to be helpful but I don't know if this is the correct solution. TRY reinstalling python3 because thats how I solved it in my case(s) else: {Just try to go near your router and then try it}
I know this maybe not great

And if you are ok what would be your opinion on a library that allows do to math arithmetic problems, Logic gates, more binary to decimal stuff, a way where you can import modules as variables without importing them but just importing the library, ml tools and libraries, file explorer kinda, info about a number and some AI. I am working on it.

@diman82
Copy link

diman82 commented Feb 6, 2021

@DjLegolas solution worked for me with an additional step - delete all pip.ini files from system!

@hiteshvvr
Copy link

@DjLegolas Thank you for the solution, it worked for me.

@MaximusExtreme
Copy link

on Windows 10 just uncheck TCP/IPv6
103758

@Tros-t
Copy link

Tros-t commented Feb 24, 2021

on Windows 10 just uncheck TCP/IPv6
103758

Windows 7 also

@OmriGilhar
Copy link

@Reiterkk Thank you so much! this problem derived me crazy for the past couple of days, I think its because I rebooted my PC with python installed on my OS.. (just a guess)

@shakedbogin
Copy link

Worked for me!! Thanks!

on Windows 10 just uncheck TCP/IPv6

image

@hng94
Copy link

hng94 commented Mar 3, 2021

  • 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

Turn off VPN, proxies if you are using.

@shafzhr
Copy link

shafzhr commented Mar 6, 2021

Looks like having ipv6 enabled causes the problem. Any ideas if it's gonna be fixed for those of us who need ipv6?

@SekiBetu
Copy link

SekiBetu commented Mar 6, 2021

Looks like having ipv6 enabled causes the problem. Any ideas if it's gonna be fixed for those of us who need ipv6?

i think, the proxy function is broken, not only because of ipv6, i'm using ipv4, still broken, only cleaned the proxy setting, it back to normal.

@pradyunsg pradyunsg added the S: needs triage Issues/PRs that need to be triaged label Mar 6, 2021
@soferdani
Copy link

@MaximusExtreme Thank you !!!!

@N0VAxf
Copy link

N0VAxf commented Mar 11, 2021

how do i get there in the settings

@InbalZelig
Copy link

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

how do i get there in the settings

@michaelkozin
Copy link

on Windows 10 just uncheck TCP/IPv6
103758

Thank you! works for me.

@carmis-dev
Copy link

on Windows 10 just uncheck TCP/IPv6
103758

Amazing. Works for me.

@Tros-t
Copy link

Tros-t commented Apr 19, 2021

just reinstall python and dont upgrade it
for me thats how it worked

@eavtur
Copy link

eavtur commented May 6, 2021

DjLegolas, carmis-dev - Many Thanks to you guys!!! God bless you!

@ghost
Copy link

ghost commented May 16, 2021

i'm on linux (mint) and the only thing that helped was to disable ipv6

i have found instructions here:
https://www.techrepublic.com/article/how-to-disable-ipv6-on-linux/

@uranusjr
Copy link
Member

Closing since this is not a bug on pip’s side, but a network configuration issue on user’s side.

Please feel free to continue the discussion here though, it’s very encouraging to see users helping out each other!

@uranusjr uranusjr added type: support User Support and removed S: needs triage Issues/PRs that need to be triaged labels May 18, 2021
@osahene
Copy link

osahene commented May 27, 2021

I solved this issue by re-installing the python installer file. I chose repair and then it now works.

@kdovlet777
Copy link

What if I use Linux (Manjaro Pahvo)?

@irungentootoo
Copy link

image

I am using a corporate proxy to access the internet, adding two variables to the environment variables helped me
http_proxy=http://myproxy:8080
https_proxy=http://myproxy:8080

maybe j for linux this will help too

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: support User Support
Projects
None yet
Development

No branches or pull requests