gpt4 book ai didi

python-3.x - Mac OS Python 3.6 无法通过 pip 安装任何包(TLS/SSL 证书)

转载 作者:行者123 更新时间:2023-12-03 17:01:50 27 4
gpt4 key购买 nike

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

  • virtualenv -p <dir_python> venv (创建 venv)
  • source venv/bin/activate (激活venv)
  • 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

  • 任何帮助深表感谢!谢谢。

    最佳答案

    我有同样的问题。

    为了解决这个问题,我只是使用 brew 更新了 python。
    brew upgrade python3

    关于python-3.x - Mac OS Python 3.6 无法通过 pip 安装任何包(TLS/SSL 证书),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59412964/

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