代码之家  ›  专栏  ›  技术社区  ›  peachykeen

尝试从终端安装PIP时出错

  •  0
  • peachykeen  · 技术社区  · 6 年前

    我正在尝试安装 pip3 通过bash脚本/终端。我使用以下命令:

    curl -O https://bootstrap.pypa.io/get-pip.py
    /usr/local/bin/python3.6 get-pip.py
    

    当我运行这两个命令时,我会得到一些我不理解的奇怪错误。有人能解释一下这些错误是什么意思以及如何修复它们吗(或者让我知道是否有比brew更好的安装pip3的方法)?

    Operating system: Mac OSX
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100 1603k  100 1603k    0     0  8216k      0 --:--:-- --:--:-- --:--:-- 8224k
    pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
    Collecting pip
      Cache entry deserialization failed, entry ignored
      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/pip/
      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/pip/
      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/pip/
      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/pip/
      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/pip/
      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
      Could not find a version that satisfies the requirement pip (from versions: )
    No matching distribution found for pip
    pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
    Cache entry deserialization failed, entry ignored
    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
    
    1 回复  |  直到 6 年前
        1
  •  3
  •   Yassine Sedrani    6 年前

    此错误消息的原因是系统中缺少SSL模块,您无法对 HTTPS url,不带“s”试试 http 而不是 https

    还是最好的 ,安装openssl brew install openssl 查看官方文档了解更多信息,祝你好运!