Repository navigation
pip connection issue in virtual enviroment #5568
Copy link
Copy link
Closed
Labels
type: supportUser SupportUser Support
Description
- pip version: 10.0.1
- Python version: 3.7
- OS: windows 10
I'm in an enterprise setup, but I'm not behind a proxy.
I'm using git bash.
Description
I can't install modules with pip when I'm inside a virtual enviroment. I can install modules with pip, when I'm not inside a virtual enviroment.
The error I'm getting is: "Failed to establish a new connection: [Errno 11003] getaddrinfo failed')': /simple/modulename"
Example of installing/updating pip with trusted hosts enabled outside the virtual enviroment
$ python -m pip install --trusted-host pypi.python.org --trusted-host files.pythonhosted.org --trusted-host pypi.org --upgrade pip
Requirement already up-to-date: pip in c:\users\penyme\appdata\local\programs\python\python37\lib\site-packages (10.0.1)
Example of the same operation within a virtual enviroment:
$ source env/Scripts/activate
x@x MINGW64 /p/Workspace/_poc/DjangoTango/DjangoTango
(env)
$ python -m pip install --trusted-host pypi.python.org --trusted-host files.pythonhosted.org --trusted-host pypi.org --upgrade pip
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x000002ABE4C84978>: Failed to establish a new connection: [Errno 11003] getaddrinfo failed')': /simple/pip/
Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x000002ABE4ABE128>: Failed to establish a new connection: [Errno 11003] getaddrinfo failed')': /simple/pip/
Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x000002ABE4C4B2E8>: Failed to establish a new connection: [Errno 11003] getaddrinfo failed')': /simple/pip/
Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x000002ABE4C76AC8>: Failed to establish a new connection: [Errno 11003] getaddrinfo failed')': /simple/pip/
Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x000002ABE4C76B70>: Failed to establish a new connection: [Errno 11003] getaddrinfo failed')': /simple/pip/
Requirement already up-to-date: pip in p:\workspace\_poc\djangotango\djangotango\env\lib\site-packages (10.0.1)
Pip is up-to-date, but when I try to install Djnago it looks like this:
$ pip install "django<1.12"
Collecting django<1.12
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x000001B8DB4D22B0>: Failed to establish a new connection: [Errno 11003] getaddrinfo failed')': /simple/django/
Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x000001B8DB4C7F60>: Failed to establish a new connection: [Errno 11003] getaddrinfo failed')': /simple/django/
Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x000001B8DB4C7EB8>: Failed to establish a new connection: [Errno 11003] getaddrinfo failed')': /simple/django/
Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x000001B8DB4C7E48>: Failed to establish a new connection: [Errno 11003] getaddrinfo failed')': /simple/django/
Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x000001B8DB4C7D68>: Failed to establish a new connection: [Errno 11003] getaddrinfo failed')': /simple/django/
Could not find a version that satisfies the requirement django<1.12 (from versions: )
No matching distribution found for django<1.12
if I try the same command on my base enviroment it looks like:
$ pip install "django<1.12"
Collecting django<1.12
Downloading https://files.pythonhosted.org/packages/bf/e0/e659df5b5b82299fffd8b3df2910c99351b9308b8f45f5702cc4cdf946e9/Django-1.11.14-py2.py3-none-any.whl (7.0MB)
Collecting pytz (from django<1.12)
Downloading https://files.pythonhosted.org/packages/30/4e/27c34b62430286c6d59177a0842ed90dc789ce5d1ed740887653b898779a/pytz-2018.5-py2.py3-none-any.whl (510kB)
Installing collected packages: pytz, django
Successfully installed django-1.11.14 pytz-2018.5
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
type: supportUser SupportUser Support
Activity
xavfernandez commentedon Jul 4, 2018
Something seems indeed to be broken inside your virtual environment.
Does
python -c "import socket;print(socket.getaddrinfo('pypi.org', 443))"work inside it ?pradyunsg commentedon Jul 4, 2018
@xavfernandez beat me to it. :)
As an aside, putting pip's output in a code block (by surrounding it with
```above and below) would make it easier to read. :)xavfernandez commentedon Jul 4, 2018
@Sidstling you apparently have an issue with the python used inside your venvs.
Is it the same as the global one ?
pradyunsg commentedon Jul 6, 2018
@Sidstling is your issue fixed? If so, it'd be helpful for someone else who might be facing this issue if you could mention how you resolved it. :)
hedrickbt commentedon Aug 22, 2019
I received the same error when I ran from a network drive (H:) vs a local (C:) drive. Python 3.6
H:\data\python\opstree>opstree_env\Scripts\activate.bat
(opstree_env) H:\data\python\opstree>pip install -r redis-load-test\Scripts\requirments.txt
Collecting locust (from -r redis-load-test\Scripts\requirments.txt (line 1))
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x000002270EB52128>: Failed to establish a new connection: [Errno 11003] getaddrinfo failed',)': /simple/locust/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x000002270EB52588>: Failed to establish a new connection: [Errno 11003] getaddrinfo failed',)': /simple/locust/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x000002270EB52390>: Failed to establish a new connection: [Errno 11003] getaddrinfo failed',)': /simple/locust/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x000002270EB52710>: Failed to establish a new connection: [Errno 11003] getaddrinfo failed',)': /simple/locust/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x000002270EB5A160>: Failed to establish a new connection: [Errno 11003] getaddrinfo failed',)': /simple/locust/