python
config_error
ai_generated
true
错误:包 'example-pkg' 需要不同的 Python 版本:3.9.2 不在 '>=3.10,<3.13' 范围内
ERROR: Package 'example-pkg' requires a different Python: 3.9.2 not in '>=3.10,<3.13'
ID: python/pip-invalid-requires-python
80%修复率
88%置信度
0证据数
2024-03-15首次发现
版本兼容性
| 版本 | 状态 | 引入 | 弃用 | 备注 |
|---|---|---|---|---|
| 3.8 | active | — | — | — |
| 3.9 | active | — | — | — |
| 3.10 | active | — | — | — |
| 3.11 | active | — | — | — |
| 3.12 | active | — | — | — |
根因分析
包的元数据指定的 Python 版本范围与当前解释器不兼容。
English
The package's metadata specifies a Python version range incompatible with the current interpreter.
解决方案
-
95% 成功率
python3.10 -m venv venv && source venv/bin/activate && pip install example-pkg
-
85% 成功率
pip install 'example-pkg<2.0' --python-version 3.9
无效尝试
常见但无效的做法:
-
70% 失败
Bypasses the check but often leads to runtime errors or import failures due to missing features/syntax.
-
90% 失败
Pip version doesn't affect the package's declared requirement; the incompatibility remains.
-
80% 失败
Violates package integrity; pip may still validate against the original metadata from the index.