# ValueError: python_requires 必须是包含有效版本说明符的字符串，而不是 '>=3.6, <4.0'

- **ID:** `python/setuptools-python-requires-invalid`
- **领域:** python
- **类别:** config_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

python_requires 值存在语法错误，例如多余空格或无效运算符。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 3.8 | active | — | — |
| 3.9 | active | — | — |
| 3.10 | active | — | — |
| 3.11 | active | — | — |
| 3.12 | active | — | — |

## 解决方案

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

## 无效尝试

- **Using a list of specifiers** — setuptools expects a single string, not a list. (90% 失败率)
- **Removing the space after the comma** — The error is about the format; a single string with commas is acceptable. (80% 失败率)
