# 错误：包 'example-pkg' 需要不同的 Python 版本：3.9.2 不在 '>=3.10,<3.13' 范围内

- **ID:** `python/pip-invalid-requires-python`
- **领域:** python
- **类别:** config_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

包的元数据指定的 Python 版本范围与当前解释器不兼容。

## 版本兼容性

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

## 解决方案

1. **** (95% 成功率)
   ```
   python3.10 -m venv venv && source venv/bin/activate && pip install example-pkg
   ```
2. **** (85% 成功率)
   ```
   pip install 'example-pkg<2.0' --python-version 3.9
   ```

## 无效尝试

- **** — Bypasses the check but often leads to runtime errors or import failures due to missing features/syntax. (70% 失败率)
- **** — Pip version doesn't affect the package's declared requirement; the incompatibility remains. (90% 失败率)
- **** — Violates package integrity; pip may still validate against the original metadata from the index. (80% 失败率)
