python - pip在Mac中给出错误 "pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available."

标签 python python-3.x pip pyenv pyenv-virtualenv

编辑:在注释中建议的答案或我找到的其他答案是主要用于linux或使用brew安装的默认python。我面临的问题是使用pyenv安装的python版本

当我尝试使用pip安装任何软件包时,出现此错误消息

WARNING: pip is configured with locations that require TLS/SSL, however the SSL module in Python is not available.
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the SSL certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with URL: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping

我正在使用pyenv,pyenv-virtualenv,并且尝试使用python 3.7.0在virtualenv中安装软件包。几天前一切正常,我怀疑将macOS更新到10.14.6导致了此问题。

在谷歌搜索或在StackOverflow上找不到任何有效的解决方案。有人可以帮我解决问题

最佳答案

上面的答案对我不起作用,任何使用pip命令都会给我同样的错误。
我终于通过使用pyenv重新安装python3来解决了这个问题,如下所示:

pyenv install 3.7.0

# pyenv: /Users/devbhadurkhadka/.pyenv/versions/3.7.0 already exists
# continue with installation? (y/N) y
谢谢大家的回答

关于python - pip在Mac中给出错误 "pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59267373/

相关文章:

python - 在处理包/蛋时,zc.buildout 是否比 pip 提供更多

python - 为什么我的神经网络显示奇怪的结果?

python - 浏览器和 wget 以不同方式加载 JPEG?

python - 从 BeautifulSoup 结果集中分离元素

python - 解析仅给定堆栈帧对象的变量名称

pip - 为什么没有python pip3.7?

python - 在 Python 中没有 .py 的模块作为脚本?

python - 如何在 Django 中记录一个文件

python - 如何使用 'expected conditions' 检查 python-selenium 中的元素?

Python - 从两个列表创建字典,其中列表名称作为键,列表元素作为值