pip 安装失败,SSL 证书验证失败 (_ssl.c:833) [英] pip install fail with SSL certificate verify failed (_ssl.c:833)
问题描述
我无法通过 pip install 安装任何外部 python 模块.我已经正确安装了 python,但是如果我使用 pip_install 它会显示这个错误.
I am not able to install any external python module through pip install. I have installed python correctly but if I use pip_install it shows me this error.
这是我运行pip install pytesseract
后的代码
C:Users190560>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
我该如何解决这个问题??
How do I solve this problem??
我可以使用这个命令部分解决问题
I can partially solve the problem by using this command
pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org <package_name>
但是我在我的电脑上找不到任何 pip.ini 文件夹这个问题在这里
but I cannot find any pip.ini folder on my computer as suggested by this question here
有什么建议可以永久解决这个问题??
Any suggestions to fix this problem permanently??
推荐答案
我在公司网络中遇到过类似问题,需要代理才能访问外部网络.在这种情况下,我们必须告诉 pip 代理:
I have experienced similar issues when I am in a corporate network where a proxy is required for external network access. In this case, we'll have to tell pip the proxy:
pip --proxy=http://your.corporate.proxy.com install pytesseract
另一个可能的原因是 pypi 域更改.在这种情况下,您可以尝试以下解决方案:
Another possible cause is due to the pypi domain change. In this case, you can try the solution as below:
pip --index-url=http://pypi.python.org/simple/ --trusted-host pypi.python.org install pytesseract
另一个类似的案例有一个很好的答案:pip 总是失败 ssl 验证一个>
Another similar case with an excellent answer: pip always fails ssl verification
这篇关于pip 安装失败,SSL 证书验证失败 (_ssl.c:833)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!