Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

Here is the code after I run the 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

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>

but I cannot find any pip.ini folder on my computer as suggested by this question here

Any suggestions to fix this problem permanently??

like image 647
Yash Soni Avatar asked Jun 21 '18 04:06

Yash Soni


1 Answers

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

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

Another similar case with an excellent answer: pip always fails ssl verification

like image 96
Wang Gang Avatar answered Oct 20 '22 08:10

Wang Gang