python
data_error
ai_generated
true
packaging.specifiers.InvalidSpecifier:无效的说明符:'>=1.0,<2.0'
packaging.specifiers.InvalidSpecifier: Invalid specifier: '>=1.0,<2.0'
ID: python/packaging-specifier-set-error
80%修复率
84%置信度
0证据数
2025-08-12首次发现
版本兼容性
| 版本 | 状态 | 引入 | 弃用 | 备注 |
|---|---|---|---|---|
| 3.8 | active | — | — | — |
| 3.9 | active | — | — | — |
| 3.10 | active | — | — | — |
| 3.11 | active | — | — | — |
| 3.12 | active | — | — | — |
根因分析
说明符字符串包含逗号,这是不允许的;说明符必须用空格分隔或作为列表传递。
English
The specifier string contains a comma, which is not allowed; specifiers must be separated by spaces or passed as a list.
解决方案
-
95% 成功率
SpecifierSet('>=1.0 <2.0') -
90% 成功率
SpecifierSet(['>=1.0', '<2.0'])
无效尝试
常见但无效的做法:
-
90% 失败
Semicolons are also not valid separators in specifiers.
-
100% 失败
Quoting does not change the invalid syntax.