'pip install generates WARNINGS : 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPConnection object at ...>

I have spent a lot of time searching if someone did already have the same issue but I did not find anything.

For some time, I have warnings each time I want to install a package with pip. The installation works at the end but it takes much more time. The warning consists in a repetition of 5 times the same WARNING :

WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPConnection object at 0x105b71c50>: Failed to establish a new connection: [Errno 61] Connection refused')': /simple/mako/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPConnection object at 0x105b6c690>: Failed to establish a new connection: [Errno 61] Connection refused')': /simple/mako/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPConnection object at 0x105b6cb90>: Failed to establish a new connection: [Errno 61] Connection refused')': /simple/mako/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPConnection object at 0x105bb6f10>: Failed to establish a new connection: [Errno 61] Connection refused')': /simple/mako/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPConnection object at 0x105bb67d0>: Failed to establish a new connection: [Errno 61] Connection refused')': /simple/mako/

After these warnings, everything seems to work well, but I would like to remove them to speed up the installations.

If you need more information, please don't hesitate to ask, I am not sure where I should dig to solve that so I don't know what kind of information would be needed.

Thank you very much for your help !



Solution 1:[1]

For some one who using win10 wsl2 of Ubuntu20 with conda environment:

Please run the following code first out of conda:

sudo apt-get update
sudo apt-get upgrade
sudo apt install python3-pip

Then activate any conda environment, the pip install can run successfully.

Solution 2:[2]

I experienced the same issue. In my case it caused that I copied pip.conf file from different machine. When I deleted this file and set all variables directly through 'pip config' command the Warnings disappeared. Hope it helped

Solution 3:[3]

Not applicable to your issue. But to anyone else experiencing this behavior while on VPN, I found a closed issue in github pip repository (https://github.com/pypa/pip/issues/7935), where the solution was to disconnect from VPN. It helped in my case, I reconnected to VPN (I am using Tunneblick) and everything is smooth and fast again.

Solution 4:[4]

I was able to install it as a su. 'sudo su' , then pip3 install sele

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Howcanoe Wang
Solution 2
Solution 3
Solution 4 Deyan