尝试从终端安装pip时出错

时间:2018-06-18 14:22:51

标签: python-3.x bash pip

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

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 个答案:

答案 0 :(得分:3)

此错误消息的原因是系统中缺少SSL模块,您无法对HTTPS网址执行任何请求,请尝试不使用“{”http代替{{1} }}

OR THE BEST ,安装OpenSSL可能会https查看官方文档以获取更多信息,祝你好运!