question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Proxy connection error with pipenv install but pip install works fine

See original GitHub issue

Version

pipenv version 2020.6.2 pip 20.1.1 python 3.7.7

Issue description

Running simply pipenv install numpy fails with the following message again and again

WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connecnnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x000002581488BCC8>: Failed to establish a new connection: [rinfo failed'))': /simple/numpy/

I am behind a corporate proxy but running pip install works fine. I have a pip.ini file where I specify the trusted hosts and the extra index urls and it seems that pipenv is reading this because, before the error I can read:

 pipenv install numpy
Installing numpy…
Error:  An error occurred while installing numpy!
Error text: Looking in indexes: https://pypi.org/simple, https://bloomberg.bintray.com/pip/simple

Any way to make it work? Many thanks

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:14 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
image357commented, Oct 8, 2020

I fixed it by using

pip install requests[security]

inside the environment where pipenv is installed (most probably global) and exporting the environment variables “HTTP_PROXY” and “HTTPS_PROXY” (usually only one is relevant).

$ export HTTP_PROXY="http://10.10.1.10:3128"
$ export HTTPS_PROXY="http://10.10.1.10:1080"

See for example: https://requests.readthedocs.io/en/master/user/advanced/#proxies

1reaction
gkedgecommented, Aug 17, 2020

my workaround is to add the CA to the cacert.pem from certifi in site-packages (/home/xxxx/.local/share/virtualenvs/pipenv-2020.6.2-BlFqa2vD/lib/python3.8/site-packages/pipenv/vendor/certifi/cacert.pem in my case)

I was unable to get any relief after adding certs this way for my internal mirror.

I would really like to be able to use pipenv without Internet access.

Read more comments on GitHub >

github_iconTop Results From Across the Web

pipenv install failing behind proxy - Stack Overflow
I am running python 3.8.13 using visual studio code and created a virtual environment through the Anaconda navigator. It's a virtual desktop ...
Read more >
Installation — JupyterLab 3.6.0b0 documentation
JupyterLab can be installed using conda , mamba , pip , pipenv or docker . ... SSL errors due to the proxy or...
Read more >
User Guide - pip documentation v22.3.1
When installing packages from PyPI, pip requires internet access, which in many corporate environments requires an outbound HTTP proxy server.
Read more >
Using Python's pip to Manage Your Projects' Dependencies
The pip command looks for the package in PyPI, resolves its dependencies, and installs everything in your current Python environment to ensure ...
Read more >
pipenv Documentation - Read the Docs
The problems that Pipenv seeks to solve are multi-faceted: ... Pipenv will install version 1.2 and any minor update, but not 2.0.
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 Reddit Thread

No results found

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