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

其他格式: JSON · Markdown 中文 · English
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.

generic

解决方案

  1. 95% 成功率 Correct the python_requires string to PEP 440 format
    python_requires = '>=3.6,<4.0' (no spaces around comma)
  2. 90% 成功率 Use a single specifier if possible
    python_requires = '>=3.6'

无效尝试

常见但无效的做法:

  1. Using a list of specifiers 90% 失败

    setuptools expects a single string, not a list.

  2. Removing the space after the comma 80% 失败

    The error is about the format; a single string with commas is acceptable.