python
config_error
ai_generated
true
错误:无效的依赖要求:'package<1.0,>=2.0'
ERROR: Invalid requirement: 'package<1.0,>=2.0'
ID: python/pip-invalid-requirement-format
80%修复率
85%置信度
0证据数
2024-03-15首次发现
版本兼容性
| 版本 | 状态 | 引入 | 弃用 | 备注 |
|---|---|---|---|---|
| 3.8 | active | — | — | — |
| 3.9 | active | — | — | — |
| 3.10 | active | — | — | — |
| 3.11 | active | — | — | — |
| 3.12 | active | — | — | — |
根因分析
依赖要求字符串中存在相互冲突的版本约束,无法同时满足。
English
The requirement string has conflicting version constraints that cannot be satisfied simultaneously.
解决方案
-
95% 成功率 Correct the version range to be non-contradictory
pip install 'package>=1.0,<2.0'
-
90% 成功率 Use a single version constraint
pip install 'package>=1.0'
无效尝试
常见但无效的做法:
-
Reordering the constraints (e.g., '>=2.0,<1.0')
95% 失败
The conflict remains regardless of order; pip parses the entire set.
-
Using a comma instead of a semicolon
90% 失败
Commas are valid separators; the issue is the logical contradiction.