gpt4 book ai didi

python - "There was a problem confirming the ssl certificate"使用 pipenv 安装

转载 作者:太空宇宙 更新时间:2023-11-03 14:31:48 25 4
gpt4 key购买 nike

我正在尝试使用 pipenv在一个新的 Django 项目中。但是,如果我尝试 pipenv install django,我会收到确认 SSL 证书的错误:

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

我最近运行了一个brew upgrade;这是我的 Pipenv 和 Python 版本:

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

我试过 Not able to install Python packages [SSL: TLSV1_ALERT_PROTOCOL_VERSION] 的答案但这基本上没有做任何事情,因为我的 pip 版本已经是最新的:

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

我正在运行 MacOS Sierra 版本 10.12.6,因此这确实似乎是由 'pip install' fails for every package ("Could not find a version that satisfies the requirement") 中描述的 TLS 1.0 弃用问题引起的.但是如何补救呢?

最佳答案

最后,我通过将我的 Macbook Pro 升级到 macOS High Sierra(版本 10.13.6)解决了这个问题。现在我可以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.

关于python - "There was a problem confirming the ssl certificate"使用 pipenv 安装,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52159269/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com