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.

[Help] after pypi change pipenv is unsuable when behind proxy.

See original GitHub issue

after change form pypi to new location, pypi.org, pipenv is fairly unusable when connection is behind the firewall(workplace network).

C:\Users\user\Desktop\ssl_test>pipenv install
Creating a virtualenv for this project.
Using C:\Python27\python.exe (2.7.14) to create virtualenv.
Running virtualenv with interpreter C:\Python27\python.exe
New python executable in C:\Users\user\.virtualenvs\ssl_test-6bhXsA1S\Scripts\python.exe
Installing setuptools, pip, wheel...
  Complete output from command C:\Users\user\.virt...S\Scripts\python.exe - setuptools pip wheel:
  Collecting setuptools
Collecting pip
  Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, u'[SSL: CERTIFICATE_
VERIFY_FAILED] certificate verify failed (_ssl.c:661)'),)': /packages/62/a1/0d452b6901b0157a0134fd27ba89bf95a857fbda64ba52e1ca2cf61d8412/pip-10.0.0-py
2.py3-none-any.whl
  Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, u'[SSL: CERTIFICATE_
VERIFY_FAILED] certificate verify failed (_ssl.c:661)'),)': /packages/62/a1/0d452b6901b0157a0134fd27ba89bf95a857fbda64ba52e1ca2cf61d8412/pip-10.0.0-py
2.py3-none-any.whl
  Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, u'[SSL: CERTIFICATE_
VERIFY_FAILED] certificate verify failed (_ssl.c:661)'),)': /packages/62/a1/0d452b6901b0157a0134fd27ba89bf95a857fbda64ba52e1ca2cf61d8412/pip-10.0.0-py
2.py3-none-any.whl
  Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, u'[SSL: CERTIFICATE_
VERIFY_FAILED] certificate verify failed (_ssl.c:661)'),)': /packages/62/a1/0d452b6901b0157a0134fd27ba89bf95a857fbda64ba52e1ca2cf61d8412/pip-10.0.0-py
2.py3-none-any.whl
  Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, u'[SSL: CERTIFICATE_
VERIFY_FAILED] certificate verify failed (_ssl.c:661)'),)': /packages/62/a1/0d452b6901b0157a0134fd27ba89bf95a857fbda64ba52e1ca2cf61d8412/pip-10.0.0-py
2.py3-none-any.whl
Exception:
Traceback (most recent call last):
  File "c:\python27\lib\site-packages\virtualenv_support\pip-9.0.3-py2.py3-none-any.whl\pip\basecommand.py", line 215, in main
    status = self.run(options, args)
  File "c:\python27\lib\site-packages\virtualenv_support\pip-9.0.3-py2.py3-none-any.whl\pip\commands\install.py", line 324, in run
    requirement_set.prepare_files(finder)
  File "c:\python27\lib\site-packages\virtualenv_support\pip-9.0.3-py2.py3-none-any.whl\pip\req\req_set.py", line 380, in prepare_files
    ignore_dependencies=self.ignore_dependencies))
  File "c:\python27\lib\site-packages\virtualenv_support\pip-9.0.3-py2.py3-none-any.whl\pip\req\req_set.py", line 620, in _prepare_file
    session=self.session, hashes=hashes)
  File "c:\python27\lib\site-packages\virtualenv_support\pip-9.0.3-py2.py3-none-any.whl\pip\download.py", line 821, in unpack_url
    hashes=hashes
  File "c:\python27\lib\site-packages\virtualenv_support\pip-9.0.3-py2.py3-none-any.whl\pip\download.py", line 659, in unpack_http_url
    hashes)
  File "c:\python27\lib\site-packages\virtualenv_support\pip-9.0.3-py2.py3-none-any.whl\pip\download.py", line 853, in _download_http_url
    stream=True,
  File "c:\python27\lib\site-packages\virtualenv_support\pip-9.0.3-py2.py3-none-any.whl\pip\_vendor\requests\sessions.py", line 521, in get
    return self.request('GET', url, **kwargs)
  File "c:\python27\lib\site-packages\virtualenv_support\pip-9.0.3-py2.py3-none-any.whl\pip\download.py", line 386, in request
    return super(PipSession, self).request(method, url, *args, **kwargs)
  File "c:\python27\lib\site-packages\virtualenv_support\pip-9.0.3-py2.py3-none-any.whl\pip\_vendor\requests\sessions.py", line 508, in request
    resp = self.send(prep, **send_kwargs)
  File "c:\python27\lib\site-packages\virtualenv_support\pip-9.0.3-py2.py3-none-any.whl\pip\_vendor\requests\sessions.py", line 618, in send
    r = adapter.send(request, **kwargs)
  File "c:\python27\lib\site-packages\virtualenv_support\pip-9.0.3-py2.py3-none-any.whl\pip\_vendor\cachecontrol\adapter.py", line 47, in send
    resp = super(CacheControlAdapter, self).send(request, **kw)
  File "c:\python27\lib\site-packages\virtualenv_support\pip-9.0.3-py2.py3-none-any.whl\pip\_vendor\requests\adapters.py", line 506, in send
    raise SSLError(e, request=request)
SSLError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Max retries exceeded with url: /packages/62/a1/0d452b6901b0157a0134fd27ba89bf9
5a857fbda64ba52e1ca2cf61d8412/pip-10.0.0-py2.py3-none-any.whl (Caused by SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify fa
iled (_ssl.c:661)'),))
----------------------------------------
...Installing setuptools, pip, wheel...done.
Traceback (most recent call last):
  File "c:\python27\lib\site-packages\virtualenv.py", line 2349, in <module>
    main()
  File "c:\python27\lib\site-packages\virtualenv.py", line 712, in main
    symlink=options.symlink)
  File "c:\python27\lib\site-packages\virtualenv.py", line 953, in create_environment
    download=download,
  File "c:\python27\lib\site-packages\virtualenv.py", line 904, in install_wheel
    call_subprocess(cmd, show_stdout=False, extra_env=env, stdin=SCRIPT)
  File "c:\python27\lib\site-packages\virtualenv.py", line 796, in call_subprocess
    % (cmd_desc, proc.returncode))
OSError: Command C:\Users\user\.virt...S\Scripts\python.exe - setuptools pip wheel failed with error code 2

Virtualenv location:
Creating a virtualenv for this project.
Using c:\python27\python.exe (2.7.14) to create virtualenv.
Already using interpreter c:\python27\python.exe
New python executable in C:\Users\user\.virtualenvs\ssl_test-6bhXsA1S\Scripts\python.exe
Installing setuptools, pip, wheel...
  Complete output from command C:\Users\user\.virt...S\Scripts\python.exe - setuptools pip wheel:
  Collecting setuptools
Collecting pip
  Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, u'[SSL: CERTIFICATE_
VERIFY_FAILED] certificate verify failed (_ssl.c:661)'),)': /packages/62/a1/0d452b6901b0157a0134fd27ba89bf95a857fbda64ba52e1ca2cf61d8412/pip-10.0.0-py
2.py3-none-any.whl
  Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, u'[SSL: CERTIFICATE_
VERIFY_FAILED] certificate verify failed (_ssl.c:661)'),)': /packages/62/a1/0d452b6901b0157a0134fd27ba89bf95a857fbda64ba52e1ca2cf61d8412/pip-10.0.0-py
2.py3-none-any.whl
  Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, u'[SSL: CERTIFICATE_
VERIFY_FAILED] certificate verify failed (_ssl.c:661)'),)': /packages/62/a1/0d452b6901b0157a0134fd27ba89bf95a857fbda64ba52e1ca2cf61d8412/pip-10.0.0-py
2.py3-none-any.whl
  Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, u'[SSL: CERTIFICATE_
VERIFY_FAILED] certificate verify failed (_ssl.c:661)'),)': /packages/62/a1/0d452b6901b0157a0134fd27ba89bf95a857fbda64ba52e1ca2cf61d8412/pip-10.0.0-py
2.py3-none-any.whl
  Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, u'[SSL: CERTIFICATE_
VERIFY_FAILED] certificate verify failed (_ssl.c:661)'),)': /packages/62/a1/0d452b6901b0157a0134fd27ba89bf95a857fbda64ba52e1ca2cf61d8412/pip-10.0.0-py
2.py3-none-any.whl
Exception:
Traceback (most recent call last):
  File "c:\python27\lib\site-packages\virtualenv_support\pip-9.0.3-py2.py3-none-any.whl\pip\basecommand.py", line 215, in main
    status = self.run(options, args)
  File "c:\python27\lib\site-packages\virtualenv_support\pip-9.0.3-py2.py3-none-any.whl\pip\commands\install.py", line 324, in run
    requirement_set.prepare_files(finder)
  File "c:\python27\lib\site-packages\virtualenv_support\pip-9.0.3-py2.py3-none-any.whl\pip\req\req_set.py", line 380, in prepare_files
    ignore_dependencies=self.ignore_dependencies))
  File "c:\python27\lib\site-packages\virtualenv_support\pip-9.0.3-py2.py3-none-any.whl\pip\req\req_set.py", line 620, in _prepare_file
    session=self.session, hashes=hashes)
  File "c:\python27\lib\site-packages\virtualenv_support\pip-9.0.3-py2.py3-none-any.whl\pip\download.py", line 821, in unpack_url
    hashes=hashes
  File "c:\python27\lib\site-packages\virtualenv_support\pip-9.0.3-py2.py3-none-any.whl\pip\download.py", line 659, in unpack_http_url
    hashes)
  File "c:\python27\lib\site-packages\virtualenv_support\pip-9.0.3-py2.py3-none-any.whl\pip\download.py", line 853, in _download_http_url
    stream=True,
  File "c:\python27\lib\site-packages\virtualenv_support\pip-9.0.3-py2.py3-none-any.whl\pip\_vendor\requests\sessions.py", line 521, in get
    return self.request('GET', url, **kwargs)
  File "c:\python27\lib\site-packages\virtualenv_support\pip-9.0.3-py2.py3-none-any.whl\pip\download.py", line 386, in request
    return super(PipSession, self).request(method, url, *args, **kwargs)
  File "c:\python27\lib\site-packages\virtualenv_support\pip-9.0.3-py2.py3-none-any.whl\pip\_vendor\requests\sessions.py", line 508, in request
    resp = self.send(prep, **send_kwargs)
  File "c:\python27\lib\site-packages\virtualenv_support\pip-9.0.3-py2.py3-none-any.whl\pip\_vendor\requests\sessions.py", line 618, in send
    r = adapter.send(request, **kwargs)
  File "c:\python27\lib\site-packages\virtualenv_support\pip-9.0.3-py2.py3-none-any.whl\pip\_vendor\cachecontrol\adapter.py", line 47, in send
    resp = super(CacheControlAdapter, self).send(request, **kw)
  File "c:\python27\lib\site-packages\virtualenv_support\pip-9.0.3-py2.py3-none-any.whl\pip\_vendor\requests\adapters.py", line 506, in send
    raise SSLError(e, request=request)
SSLError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Max retries exceeded with url: /packages/62/a1/0d452b6901b0157a0134fd27ba89bf9
5a857fbda64ba52e1ca2cf61d8412/pip-10.0.0-py2.py3-none-any.whl (Caused by SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify fa
iled (_ssl.c:661)'),))
----------------------------------------
...Installing setuptools, pip, wheel...done.
Traceback (most recent call last):
  File "c:\python27\lib\runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "c:\python27\lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "c:\python27\lib\site-packages\virtualenv.py", line 2349, in <module>
    main()
  File "c:\python27\lib\site-packages\virtualenv.py", line 712, in main
    symlink=options.symlink)
  File "c:\python27\lib\site-packages\virtualenv.py", line 953, in create_environment
    download=download,
  File "c:\python27\lib\site-packages\virtualenv.py", line 904, in install_wheel
    call_subprocess(cmd, show_stdout=False, extra_env=env, stdin=SCRIPT)
  File "c:\python27\lib\site-packages\virtualenv.py", line 796, in call_subprocess
    % (cmd_desc, proc.returncode))
OSError: Command C:\Users\user\.virt...S\Scripts\python.exe - setuptools pip wheel failed with error code 2

Virtualenv location:
Installing dependencies from Pipfile.lock (36eec0).
  ================================ 6/6 - 00:00:02
To activate this project's virtualenv, run the following:
 $ pipenv shell

C:\Users\user\Desktop\ssl_test>

in a pipenv is there any way to disable SSL check false?

I already try to add custom certificate to certifi, and now requests package does work with providing the custom path but not sure how can do the same for pipenv.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
dhruvinshcommented, Jun 12, 2018

it started happening again for me, even with PIP_TRUSTED_HOST=files.python.org, is there any way to supply ssl certificate to pipenv?

pipenv install flask-marshmallow
Installing flask-marshmallow…
Looking in indexes: https://pypi.python.org/simple
Requirement already satisfied: flask-marshmallow in c:\cygwin64\home\dshah\.virtualenvs\eco_check-ulezzimx\lib\site-packages (0.9.0)
Requirement already satisfied: six>=1.9.0 in c:\cygwin64\home\dshah\.virtualenvs\eco_check-ulezzimx\lib\site-packages (from flask-marshmallow) (1.11.0)
Requirement already satisfied: Flask in c:\cygwin64\home\dshah\.virtualenvs\eco_check-ulezzimx\lib\site-packages (from flask-marshmallow) (1.0.2)
Requirement already satisfied: marshmallow>=2.0.0 in c:\cygwin64\home\dshah\.virtualenvs\eco_check-ulezzimx\lib\site-packages (from flask-marshmallow) (2.15.3)
Requirement already satisfied: itsdangerous>=0.24 in c:\cygwin64\home\dshah\.virtualenvs\eco_check-ulezzimx\lib\site-packages (from Flask->flask-marshmallow) (0.24)
Requirement already satisfied: Jinja2>=2.10 in c:\cygwin64\home\dshah\.virtualenvs\eco_check-ulezzimx\lib\site-packages (from Flask->flask-marshmallow) (2.10)
Requirement already satisfied: click>=5.1 in c:\cygwin64\home\dshah\.virtualenvs\eco_check-ulezzimx\lib\site-packages (from Flask->flask-marshmallow) (6.7)
Requirement already satisfied: Werkzeug>=0.14 in c:\cygwin64\home\dshah\.virtualenvs\eco_check-ulezzimx\lib\site-packages (from Flask->flask-marshmallow) (0.14.1)
Requirement already satisfied: MarkupSafe>=0.23 in c:\cygwin64\home\dshah\.virtualenvs\eco_check-ulezzimx\lib\site-packages (from Jinja2>=2.10->Flask->flask-marshmallow) (1.0)

Adding flask-marshmallow to Pipfile's [packages]…
Pipfile.lock (6aec20) out of date, updating to (b0cf6f)…
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
or\requests\sessions.py", line 508, in request
    resp = self.send(prep, **send_kwargs)
  File "c:\python27\lib\site-packages\pipenv\vendor\requests\sessions.py", line 618, in send
    r = adapter.send(request, **kwargs)
  File "c:\python27\lib\site-packages\pipenv\vendor\requests\adapters.py", line 506, in send
    raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /pypi/cachecontrol/json (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')],)",),))
0reactions
martinspielmanncommented, Sep 17, 2019

try PIP_TRUSTED_HOST=files.pythonhosted.org instead. *note the additional ‘hosted’

Read more comments on GitHub >

github_iconTop Results From Across the Web

pipenv install failing behind proxy - Stack Overflow
I have installed pipenv (v2022.7.4). I am running python 3.8.13 using visual studio code and created a virtual environment through the Anaconda ...
Read more >
Advanced Usage of Pipenv - Read the Docs
If you would like to override the default PyPI index URLs with the URL for a PyPI mirror, you can use the following:...
Read more >
pipenv Documentation - Read the Docs
All un- specified packages are resolved using the default index source; the default package index is PyPI. For a specific package to be...
Read more >
Configure a Pipenv environment | IntelliJ IDEA Documentation
Run the following command: $ py -m site --user-site. A sample output can be: · Replace site-packages with Scripts in this path to...
Read more >
PyPI mirror support in pipenv - Jacob Henner
As of June 25th, pipenv supports overriding PyPI urls with mirror indices. This is useful for developers who want to use a PyPI...
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