简体   繁体   中英

“There was a problem confirming the ssl certificate” using pipenv install

I'm trying to use pipenv in a new Django project. However, if I try to pipenv install django , I get an error confirming the SSL certificate:

Kurts-MacBook-Pro:wemap kurtpeek$ pipenv install django
Installing django...
Collecting django
  Could not fetch URL https://pypi.python.org/simple/django/: There was a problem confirming the ssl certificate: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590) - skipping

Error:  An error occurred while installing django!
  Could not find a version that satisfies the requirement django (from versions: )
No matching distribution found for django

I've recently run a brew upgrade ; here are my Pipenv and Python versions:

Kurts-MacBook-Pro:wemap kurtpeek$ pipenv --version
pipenv, version 2018.7.1
Kurts-MacBook-Pro:wemap kurtpeek$ python --version
Python 3.7.0

I've tried the answer of Not able to install Python packages [SSL: TLSV1_ALERT_PROTOCOL_VERSION] but this essentially didn't do anything as my pip version was already up-to-date:

Kurts-MacBook-Pro:wemap kurtpeek$ curl https://bootstrap.pypa.io/get-pip.py | python
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 1604k  100 1604k    0     0   583k      0  0:00:02  0:00:02 --:--:--  583k
Collecting pip
  Using cached https://files.pythonhosted.org/packages/5f/25/e52d3f31441505a5f3af41213346e5b6c221c9e086a166f3703d2ddaf940/pip-18.0-py2.py3-none-any.whl
Installing collected packages: pip
  Found existing installation: pip 18.0
    Uninstalling pip-18.0:
      Successfully uninstalled pip-18.0
Successfully installed pip-18.0

I am running MacOS Sierra version 10.12.6, so this does indeed seem to be caused by the TLS 1.0 deprecation issue described in 'pip install' fails for every package ("Could not find a version that satisfies the requirement") . But how to remedy this?

In the end, I solved this by upgrading my Macbook Pro to macOS High Sierra (Version 10.13.6). Now I can pipenv install django :

Kurts-MacBook-Pro:wemap kurtpeek$ pipenv install django
Creating a Pipfile for this project...
Installing django...
Requirement already satisfied: django in /Users/kurtpeek/.local/share/virtualenvs/wemap-X_Ia-lVq/lib/python2.7/site-packages
Requirement already satisfied: pytz in /Users/kurtpeek/.local/share/virtualenvs/wemap-X_Ia-lVq/lib/python2.7/site-packages (from django)

Adding django to Pipfile's [packages]...
Pipfile.lock not found, creating...
Locking [dev-packages] dependencies...
Locking [packages] dependencies...
Updated Pipfile.lock (71a00b)!
Installing dependencies from Pipfile.lock (71a00b)...
  🐍   ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 2/2 — 00:00:00
To activate this project's virtualenv, run pipenv shell.
Alternatively, run a command inside the virtualenv with pipenv run.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM