python
config_error
ai_generated
true
ValueError: python_requires must be a string containing a valid version specifier, not '>=3.6, <4.0'
ID: python/setuptools-python-requires-invalid
80%Fix Rate
85%Confidence
0Evidence
2025-12-20First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 3.8 | active | — | — | — |
| 3.9 | active | — | — | — |
| 3.10 | active | — | — | — |
| 3.11 | active | — | — | — |
| 3.12 | active | — | — | — |
Root Cause
The python_requires value has a syntax error, such as an extra space or invalid operator.
generic中文
python_requires 值存在语法错误,例如多余空格或无效运算符。
Workarounds
-
95% success Correct the python_requires string to PEP 440 format
python_requires = '>=3.6,<4.0' (no spaces around comma)
-
90% success Use a single specifier if possible
python_requires = '>=3.6'
Dead Ends
Common approaches that don't work:
-
Using a list of specifiers
90% fail
setuptools expects a single string, not a list.
-
Removing the space after the comma
80% fail
The error is about the format; a single string with commas is acceptable.