python network_error ai_generated true

ERROR: Could not install packages due to an OSError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Max retries exceeded with url: /packages/... (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate')))

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

Also available as: JSON · Markdown · 中文
80%Fix Rate
85%Confidence
0Evidence
2025-01-15First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
3.10 active

Root Cause

SSL certificate verification fails due to missing or outdated CA certificates on the system.

generic

中文

由于系统缺少或CA证书过期,SSL证书验证失败。

Workarounds

  1. 90% success Update CA certificates
    pip install --upgrade certifi
    # Or system level: sudo update-ca-certificates
  2. 85% success Use a custom CA bundle if behind corporate proxy
    pip install --cert /path/to/custom-ca-bundle.crt package

Dead Ends

Common approaches that don't work:

  1. Disabling SSL verification with --trusted-host 30% fail

    Security risk; may work but exposes to man-in-the-middle attacks.

  2. Using --cert with wrong path 70% fail

    Path to certificate may be incorrect or file missing.