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

- **ID:** `python/pip-tls-ssl-error`
- **领域:** python
- **类别:** network_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

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

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 3.8 | active | — | — |
| 3.9 | active | — | — |
| 3.10 | active | — | — |
| 3.11 | active | — | — |
| 3.12 | active | — | — |

## 解决方案

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

## 无效尝试

- **Using pip install with --trusted-host** — This bypasses certificate validation but does not fix the SSL version mismatch. (70% 失败率)
- **Reinstalling Python without updating OpenSSL** — The issue is at the system level, not Python itself. (80% 失败率)
