python
data_error
ai_generated
true
错误:无效的依赖项:'package===1.0.0'
ERROR: Invalid requirement: 'package===1.0.0'
ID: python/pip-install-error-invalid-requirement-double-equals
80%修复率
87%置信度
0证据数
2025-04-05首次发现
版本兼容性
| 版本 | 状态 | 引入 | 弃用 | 备注 |
|---|---|---|---|---|
| 3.x | active | — | — | — |
根因分析
版本说明符使用了三个等号(===),这不是 PEP 440 中的有效运算符;只允许 ==、>=、<=、>、<、~=、!=。
English
The version specifier uses triple equals (===) which is not a valid operator in PEP 440; only ==, >=, <=, >, <, ~=, != are allowed.
解决方案
-
99% 成功率
pip install package==1.0.0
-
90% 成功率
pip install 'package~=1.0.0'
-
85% 成功率
Refer to the packaging documentation for correct syntax.
无效尝试
常见但无效的做法:
-
90% 失败
Quoting does not fix the invalid operator.
-
95% 失败
Newer pip still enforces valid operators.
-
95% 失败
Force reinstall does not bypass parsing.