Sourabrt
Sourabrt

Reputation: 2336

pip3 install failed due to an EnvironmentError

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)'),))

Upvotes: 2

Views: 4623

Answers (2)

Luiz fernando Ripardo
Luiz fernando Ripardo

Reputation: 21

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)"

Upvotes: 2

kartoon
kartoon

Reputation: 1194

Try reinstalling pip

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

If it doesn't work, check this solution.

Upvotes: 2

Related Questions