Python – Fix SSL Certificate Verified Failed

Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘SSLError(SSLCertVerificationError(1, ‘[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1076)’))’: /simple/prettytable/


pip install --trusted-host --trusted-host prettytable


pip install --trusted-host --trusted-host --trusted-host prettytable

Change “prettytable” to whatever you’re trying to install.  Also note the first command works for me every time but if it doesn’t for you, try the second command.


The error message you see is related to SSL certificate verification when the Python package manager, pip, tries to download a package from the Python Package Index (PyPI).

In this case, it’s failing to download the prettytable package because the certificate presented by the server (or an intermediary such as a proxy) is self-signed, and Python can’t verify it. SSL Offloading was the root cause of this, which many companies do.