【发布时间】:2018-11-30 07:36:21
【问题描述】:
我无法通过 pip install 安装任何外部 python 模块。 我已经正确安装了 python,但是如果我使用 pip_install 它会显示这个错误。
这是我运行pip install pytesseract后的代码
C:\Users\190560>pip install pytesseract
Collecting pytesseract
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:833)'),)': /simple/pytesseract/
Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:833)'),)': /simple/pytesseract/
Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:833)'),)': /simple/pytesseract/
Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:833)'),)': /simple/pytesseract/
Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:833)'),)': /simple/pytesseract/
Could not fetch URL https://pypi.org/simple/pytesseract/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pytesseract/ (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:833)'),)) - skipping
Could not find a version that satisfies the requirement pytesseract (from versions: )
No matching distribution found for pytesseract
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(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:833)'),)) - skipping
我该如何解决这个问题??
使用这个命令我可以部分解决问题
pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org <package_name>
但我无法在我的计算机上找到任何 pip.ini 文件夹,如建议的那样 this question here
有什么建议可以永久解决这个问题吗?
【问题讨论】:
-
您在公司网络中工作吗?
-
@srj 不,我没有使用任何公司网络!!
-
有几种不同的因素会导致这种情况。首先,请参阅this question。按照
install -U pip setuptools的答案去做。如果可行,看看pip现在是否可以在没有trusted-host的情况下工作。如果是这样,那是你的问题。如果没有,您需要向您提供更多信息:您使用的平台、Python 版本以及安装方式(python.org 安装程序、apt-get 等)、哪些步骤失败以及输出是什么. -
@abarnert 我使用的是 Windows 10 平台,我使用的是最新版本的 python,即 python 3.6.5。我通过 python.org 安装程序安装了它。我唯一失败的步骤是我上面提到的那一步,并且还指定了错误。
-
您是否使用
-U pip setuptools完成了pip install --trusted-host <etc.>?至少在某些情况下,这就是您将临时/部分解决方案转变为永久解决方案的方式,这就是我要求您这样做的原因。
标签: python pip ssl-certificate