python
config_error
ai_generated
true
ValueError: python_requires 必须是包含有效版本说明符的字符串,而不是 '>=3.6, <4.0'
ValueError: python_requires must be a string containing a valid version specifier, not '>=3.6, <4.0'
ID: python/setuptools-python-requires-invalid
80%修复率
85%置信度
0证据数
2025-12-20首次发现
版本兼容性
| 版本 | 状态 | 引入 | 弃用 | 备注 |
|---|---|---|---|---|
| 3.8 | active | — | — | — |
| 3.9 | active | — | — | — |
| 3.10 | active | — | — | — |
| 3.11 | active | — | — | — |
| 3.12 | active | — | — | — |
根因分析
python_requires 值存在语法错误,例如多余空格或无效运算符。
English
The python_requires value has a syntax error, such as an extra space or invalid operator.
解决方案
-
95% 成功率 Correct the python_requires string to PEP 440 format
python_requires = '>=3.6,<4.0' (no spaces around comma)
-
90% 成功率 Use a single specifier if possible
python_requires = '>=3.6'
无效尝试
常见但无效的做法:
-
Using a list of specifiers
90% 失败
setuptools expects a single string, not a list.
-
Removing the space after the comma
80% 失败
The error is about the format; a single string with commas is acceptable.