# 错误：包'mypkg'需要不同的Python版本：3.11.2不在'>=3.12'中

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

## 根因

包的Requires-Python元数据指定的版本范围不包括当前运行的Python解释器。

## 版本兼容性

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

## 解决方案

1. **** (95% 成功率)
   ```
   Install a compatible Python version, e.g., using pyenv: pyenv install 3.12
   ```
2. **** (90% 成功率)
   ```
   Use a virtual environment with the correct Python: python3.12 -m venv venv
   ```

## 无效尝试

- **** — This flag is not supported by pip; it's a misconception. Pip will still enforce the requirement. (100% 失败率)
- **** — Pip version does not change Python version compatibility; the issue is with the interpreter itself. (90% 失败率)
