python network_error ai_generated true

错误:由于 OSError 无法安装包:[Errno 1] _ssl.c:510: error:1408F10B:SSL routines:ssl3_get_record:wrong version number

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

其他格式: JSON · Markdown 中文 · English
80%修复率
85%置信度
0证据数
2024-10-03首次发现

版本兼容性

版本状态引入弃用备注
3.8 active
3.9 active
3.10 active
3.11 active
3.12 active

根因分析

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

English

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

generic

解决方案

  1. 85% 成功率 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% 成功率 Use a Python version compiled with a newer OpenSSL
    Install Python 3.11 or later from python.org which bundles OpenSSL 1.1.1+

无效尝试

常见但无效的做法:

  1. Using pip install with --trusted-host 70% 失败

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

  2. Reinstalling Python without updating OpenSSL 80% 失败

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