Open duncanmcbryde opened 2 years ago
Here is the output of pip after trying to install a package without numby-base present broken by NewConnectionError
on WSL 1
conda run -n test pip install --no-cache-dir asn1crypto
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fb70a269130>: Failed to establish a new connection: [Errno -2] Name or service not known')': /simple/asn1crypto/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fb70a269460>: Failed to establish a new connection: [Errno -2] Name or service not known')': /simple/asn1crypto/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fb70a2696d0>: Failed to establish a new connection: [Errno -2] Name or service not known')': /simple/asn1crypto/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fb70a269880>: Failed to establish a new connection: [Errno -2] Name or service not known')': /simple/asn1crypto/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fb70a269a30>: Failed to establish a new connection: [Errno -2] Name or service not known')': /simple/asn1crypto/
ERROR: Could not find a version that satisfies the requirement asn1crypto (from versions: none)
ERROR: No matching distribution found for asn1crypto
WARNING: There was an error checking the latest version of pip.
While monitoring the connection with Wireshark, no packets are generated. Whith numpy-base present, we can see the packets generated and connections made, and the download succeeds.
Hi @duncanmcbryde,
Thank you for reporting this bug. I have just tried this myself on my Windows computer running the WSL and was able to recreate it.
I am not sure when we will be able to look into this further, but we will update this issue when/if we do.
Reproduced today on a recent updated installation:
I encounter similar issue with latest conda and python3.10.
Inspired by the issue, a temp solution is run conda install numpy-base
before using pip
Almost 2 years after, this bug keep happening (Windows PRO / WSL 1 / Ubuntu 22.04).
To update this thread, upgrade the packages works for me.
sudo apt-get update sudo apt-get upgrade
Checklist
What happened?
If conda is installed in a WSL 1 Ubuntu environment, pip cannot connect to the internet when installed in an environment with python versions 3.7 and above. Creating a new environment with only pip and python causes pip to fail to establish connections, but when numpy-base is installed (and dependencies) pip is able to connect to PyPi.
This only affects WSL 1, it does not affect WSL 2.
I've confirmed this with multiple computers and a VM running Ubuntu 18.04, and it's consistent on conda versions 4.12, 4.14 and 22.9 on Ubuntu 18.04 freshly installed, as well as working on a new windows virtual machine.
To create a minimal test case, once conda is installed in a WSL 1, create a new environment called "test" with python 3.7 and pip and try to install pytz. This fails
conda create -y -n test python=3.7 pip && conda run -n test pip install pytz
This works
conda create -y -n test python=3.7 pip numy-base && conda run -n test pip install pytz
This is also affects python 3.7, 3.8, 3.9, 3.10. Python version 3.6 does not have this problem. Switching pip versions does not affect the bug.
We originally though this was a firewall or networking configuration, but after testing it on 3 computers and 3 networks it appears to be replaceable.
Conda Info