python network_error ai_generated true

ERROR: Could not install packages due to an OSError: [Errno 1] _ssl.c:510: error:1408F10B:SSL routines:ssl3_get_record:wrong version number

ID: python/pip-tls-ssl-error

Also available as: JSON · Markdown · 中文
80%Fix Rate
85%Confidence
0Evidence
2024-10-03First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
3.8 active
3.9 active
3.10 active
3.11 active
3.12 active

Root Cause

The system's OpenSSL version is outdated or misconfigured, causing TLS handshake failures.

generic

中文

系统 OpenSSL 版本过旧或配置错误,导致 TLS 握手失败。

Workarounds

  1. 85% success Upgrade OpenSSL on the system
    sudo apt-get update && sudo apt-get install --only-upgrade openssl (Debian/Ubuntu) or brew upgrade openssl (macOS)
  2. 90% success Use a Python version compiled with a newer OpenSSL
    Install Python 3.11 or later from python.org which bundles OpenSSL 1.1.1+

Dead Ends

Common approaches that don't work:

  1. Using pip install with --trusted-host 70% fail

    This bypasses certificate validation but does not fix the SSL version mismatch.

  2. Reinstalling Python without updating OpenSSL 80% fail

    The issue is at the system level, not Python itself.