我无法通过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 install --trusted-host <etc.>
和-U pip setuptools
命令?在某些情况下,这是将临时/部分解决方案转化为永久修复的方法,这就是我要求你执行该命令的原因。 - abarnert