当前位置: 首页 > 面试题库 >

带有SSL证书的pip安装失败,验证失败(_ssl.c:833)

凌俊材
2023-03-14
问题内容

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

有任何永久解决此问题的建议吗?


问题答案:

当我在需要外部网络访问权限代理的公司网络中时,我遇到了类似的问题。在这种情况下,我们必须告诉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安装安装任何外部python模块。我已经正确安装了python,但如果我使用pip_install它显示我这个错误。 下面是我运行

  • 我在Windows上设置了Rails项目和数据库,一些宝石丢失了。当试图安装他们我得到以下错误: 我试过了 https://gist.github.com/luislavena/f064211759ee0f806c88 和 SSL错误安装rubygem时,无法从https://rubygems.org/ 但这些都没有奏效。有什么想法吗?

  • 问题内容: 尝试上使用。 无论软件包如何,pip安装都会失败。例如,还会导致SSL错误。 原始安装的Python 3.4.1包含pip 1.5.6。我尝试做的第一件事是安装已经安装,它是ArcGIS附带的。python并且pip直到我安装3.4.1时才可从命令行使用。 作品。可能是因为点子搜索无法验证站点的SSL证书。 我在公司网络中,但是我们不通过代理访问Internet。 每台公司计算机(包括

  • 问题内容: 我正在尝试使用pip为Python安装Scrapy软件包(以及其他)。我曾尝试做使用python 3和python 2安装,我已经安装/升级,像这样的setuptools:我曾尝试使用选项像这样:。但是当我运行时,我总是收到相同的错误消息。完整的输出是这样的: 我在Mac OS版本10.12.1上,并且正在使用python 3.6。有人知道这个问题的解决方案吗? 问题答案: 如此处所述

  • 问题内容: 尝试运行Discord机器人时,遇到此错误: 它刚刚开始无处不在,并且每次都在发生。 我在Windows 10上使用python 3.8 这是什么意思,我该如何解决? 问题答案: 要解决此问题: 使用Internet Explorer转到discord.com(以管理员身份运行) 点击右上角的锁 点击查看证书 安装一个 PS:如果您的防病毒软件对Web浏览器有效,并且此解决方案不起作用