python
data_error
ai_generated
true
ERROR: Invalid requirement: 'package == 1.0.0'
ID: python/pip-install-error-invalid-requirement-whitespace
80%Fix Rate
88%Confidence
0Evidence
2025-07-10First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 3.x | active | — | — | — |
Root Cause
The requirement string contains spaces around the operator, which is not allowed in pip requirement syntax.
generic中文
依赖项字符串在运算符周围包含空格,这在 pip 依赖项语法中是不允许的。
Workarounds
-
99% success
pip install package==1.0.0
-
95% success
echo 'package==1.0.0' > requirements.txt && pip install -r requirements.txt
-
85% success
Refer to pip's documentation on requirement specifiers.
Dead Ends
Common approaches that don't work:
-
90% fail
Quoting does not fix the whitespace issue.
-
95% fail
Newer pip still enforces no whitespace around operators.
-
95% fail
Force reinstall does not bypass parsing.