python
data_error
ai_generated
true
ERROR: packaging.requirements.InvalidRequirement: Expected end of string, got ';' in requirement 'requests>=2.25; extra == "security"'
ID: python/packaging-requirement-parsing-error
80%Fix Rate
85%Confidence
0Evidence
2026-01-10First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 3.9 | active | — | — | — |
| 3.10 | active | — | — | — |
Root Cause
The requirement string uses extras syntax incorrectly; extras must be enclosed in square brackets, not separated by semicolon.
generic中文
需求字符串错误地使用了 extras 语法;extras 必须用方括号括起来,而不是用分号分隔。
Workarounds
-
95% success Use correct extras syntax with square brackets
Write: 'requests[security]>=2.25' (extras inside brackets).
-
90% success Use environment markers for conditional dependencies
Write: 'requests>=2.25; extra == "security"' but note that this is for markers, not extras. For extras, use brackets.
Dead Ends
Common approaches that don't work:
-
Removing the semicolon and extra entirely
70% fail
Loses the conditional requirement.
-
Using a comma instead of semicolon
80% fail
Comma is not valid for extras syntax.