Fix pip "CERTIFICATE_VERIFY_FAILED" SSL error
pip checks the HTTPS certificate of the package index. This error means it could not verify the certificate chain.
Typical causes
- A company proxy or antivirus that re-signs HTTPS traffic with its own certificate.
- An outdated Python or pip with old trusted certificates.
- A wrong system date and time.
Safe fixes
- Check your system clock.
- Upgrade pip and Python.
- If a proxy re-signs traffic, ask your IT team for the root certificate file and point pip at it:
pip install --cert /path/to/company-ca.pem package-name
You can also set it in the pip configuration file with the cert option.
Avoid this
The --trusted-host option skips verification for a host. It works, but it removes the protection HTTPS gives you, so use it only as a short-term step on a network you trust.