【问题标题】:ssl module in Python is not available on macosPython 中的 ssl 模块在 macos 上不可用
【发布时间】:2020-03-11 03:41:50
【问题描述】:

所以这听起来像是多个其他锅的重复(12),但这些锅都不能解决我的问题。

我正在尝试运行pip3 install pipenv 命令并收到以下错误

$ pip3 install pipenv
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/pipenv/
WARNING: Retrying (Retry(total=3, 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/pipenv/
WARNING: Retrying (Retry(total=2, 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/pipenv/
WARNING: Retrying (Retry(total=1, 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/pipenv/
WARNING: Retrying (Retry(total=0, 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/pipenv/
Could not fetch URL https://pypi.org/simple/pipenv/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pipenv/ (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 pipenv (from versions: none)
ERROR: No matching distribution found for pipenv
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

我已经尝试过brew uninstall openssl,然后是brew install openssl(我必须使用--ignore-dependency 标志进行卸载,因为我安装了awscli,它正在使用它)。我还在~/.zshrc中设置了以下变量@

 $ tail -4 ~/.zshrc
export PATH="/usr/local/opt/openssl/bin:$PATH"
export CPPFLAGS=-I$(brew --prefix openssl)/include
export LDFLAGS=-L$(brew --prefix openssl)/lib
export PKG_CONFIG_PATH="/usr/local/opt/openssl@1.1/lib/pkgconfig"

所以我不知道还能做什么。

【问题讨论】:

    标签: python pip openssl homebrew


    【解决方案1】:

    对我来说,切换到旧版本的 openssl 是可行的:

    brew switch openssl 1.0.2t

    我使用的是 Mac OS Catalina 10.15.3。希望对您有所帮助。

    【讨论】:

      猜你喜欢
      • 2020-02-05
      • 2020-05-02
      • 1970-01-01
      • 2022-07-25
      • 1970-01-01
      • 1970-01-01
      • 2019-10-26
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多