【问题标题】:Mac OS Python 3.6 unable to pip install any package (TLS/SSL certificate)Mac OS Python 3.6 无法 pip 安装任何包(TLS/SSL 证书)
【发布时间】:2020-04-12 05:48:44
【问题描述】:

我使用的是 Mac OS 10.15.2 (Catalina)。预装了 Python 2 和 3.7(/usr/bin/python/usr/bin/python3),我已经安装了带有 brew 的 Python 3.6(/usr/local/bin/python3)。另外,我使用的虚拟环境如下:

  1. virtualenv -p <dir_python> venv(创建 venv)
  2. source venv/bin/activate(激活 venv)
  3. pip install <package>(安装包)

当我使用 Python 2 和 3.7 创建虚拟环境时,一切正常。 每当我使用 Python 3.6 时,我都无法安装任何东西。例如,使用“numpy”,我得到以下信息:

WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.

WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.",)': /simple/numpy/

... retrying for four more times ...  

Could not fetch URL https://pypi.org/simple/numpy/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/numpy/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.",)) - skipping

ERROR: Could not find a version that satisfies the requirement numpy (from versions: none)

ERROR: No matching distribution found for numpy

我尝试了其他帖子中的一些内容,这些帖子描述了看似相似的内容,但以下内容均无济于事,例如:

  • 卸载并重新安装 Python 3.6
  • pip install --upgrade pip --trusted-host pypi.org --trusted-host files.pythonhosted.org pip setuptools

非常感谢任何帮助!谢谢。

【问题讨论】:

标签: python-3.x macos pip python-3.6


【解决方案1】:

我也遇到了同样的问题。

为了修复它,我刚刚使用 brew 更新了 python。

brew upgrade python3

【讨论】:

  • 很方便,谢谢 - 这解决了我在 Mac 上安装 torch 的问题
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-08-21
  • 1970-01-01
  • 1970-01-01
  • 2017-04-27
  • 1970-01-01
相关资源
最近更新 更多