python network_error ai_generated true

ERROR: Could not fetch URL https://pypi.org/simple/package/: There was a problem confirming the ssl certificate: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)

ID: python/pip-install-error-ssl-certificate-verify-failed

Also available as: JSON · Markdown · 中文
80%Fix Rate
86%Confidence
0Evidence
2024-05-12First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
3.x active — — —

Root Cause

pip cannot verify the SSL certificate of the package index, often due to missing CA certificates, corporate proxy interception, or outdated certifi bundle.

generic

中文

pip 无法验证包索引的 SSL 证书,通常是由于缺少 CA 证书、企业代理拦截或 certifi 包过时。

Workarounds

  1. 80% success
    pip install --upgrade certifi
  2. 90% success
    sudo apt-get install ca-certificates && sudo update-ca-certificates
  3. 85% success
    pip install --cert /path/to/corporate-ca-bundle.crt package

Dead Ends

Common approaches that don't work:

  1. 60% fail

    This bypasses security and may still fail if the proxy requires a specific CA.

  2. 95% fail

    Reinstalling Python does not fix missing or outdated CA certificates.

  3. 90% fail

    PyPI redirects HTTP to HTTPS; the SSL error persists.