2

I'm trying to install imutils and dlib via pip on my 64 bit ARMV8 board. pip3 install imutils throws certificate verify failed error. I now have to use pip3 install imutils --trusted-host pypi.org --trusted-host files.pythonhosted.org to bypass that certificate error. It was working fine earlier, but suddenly it started giving this error. How can i fix this instead of writing --trusted-host everytime? ERROR:

Collecting imutils
  WARNING: 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:720)'),)': /packages/b5/94/46dcae8c061e28be31bcaa55c560cb30ee9403c9a4bb2659768ec1b9eb7d/imutils-0.5.3.tar.gz
  WARNING: 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:720)'),)': /packages/b5/94/46dcae8c061e28be31bcaa55c560cb30ee9403c9a4bb2659768ec1b9eb7d/imutils-0.5.3.tar.gz
  WARNING: 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:720)'),)': /packages/b5/94/46dcae8c061e28be31bcaa55c560cb30ee9403c9a4bb2659768ec1b9eb7d/imutils-0.5.3.tar.gz
  WARNING: 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:720)'),)': /packages/b5/94/46dcae8c061e28be31bcaa55c560cb30ee9403c9a4bb2659768ec1b9eb7d/imutils-0.5.3.tar.gz
  WARNING: 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:720)'),)': /packages/b5/94/46dcae8c061e28be31bcaa55c560cb30ee9403c9a4bb2659768ec1b9eb7d/imutils-0.5.3.tar.gz
ERROR: Could not install packages due to an EnvironmentError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Max retries exceeded with url: /packages/b5/94/46dcae8c061e28be31bcaa55c560cb30ee9403c9a4bb2659768ec1b9eb7d/imutils-0.5.3.tar.gz (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:720)'),))
Sourabrt
  • 2,126
  • 2
  • 8
  • 22

2 Answers2

2

Try reinstalling pip

python -m pip install --upgrade --force-reinstall pip

If it doesn't work, check this solution.

kartoon
  • 1,040
  • 1
  • 11
  • 24
  • I have added trusted hosts to my conf file. But I'm not sure if it is fixing the core issue? I think it just bypasses the check. I've no clue. – Sourabrt Apr 23 '20 at 12:01
  • It doesn't bypass the check. It initially checks if your package is available in the trusted hosts, if not, then you have to add that trusted host where the package is available. So the check to trusted host is always made. – kartoon Apr 23 '20 at 12:08
2
install --trusted-host pypi.org --trusted-host files.pythonhosted.org <package_name>

example

install --trusted-host pypi.org --trusted-host files.pythonhosted.org pandas
install --trusted-host pypi.org --trusted-host files.pythonhosted.org matplotlib
install --trusted-host pypi.org --trusted-host files.pythonhosted.org opencv-python

for more information see this answer

pip install fails with "connection error: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:598)"

ahrberg
  • 617
  • 1
  • 8
  • 19