gpt4 book ai didi

python - pip install failed with SSL certificate verify failed (_ssl.c :833)

转载 作者:行者123 更新时间:2023-12-04 14:54:14 24 4
gpt4 key购买 nike

我无法通过 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

有什么建议可以永久解决这个问题吗??

最佳答案

当我在需要代理才能访问外部网络的公司网络中时,我遇到了类似的问题。在这种情况下,我们必须告诉 pip 代理:

pip --proxy=http://your.corporate.proxy.com  install pytesseract

另一个可能的原因是由于 pypi 域更改。在这种情况下,您可以尝试以下解决方案:
pip --index-url=http://pypi.python.org/simple/ --trusted-host pypi.python.org install pytesseract

另一个类似的案例,答案很好: pip always fails ssl verification

关于python - pip install failed with SSL certificate verify failed (_ssl.c :833),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50960583/

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