# distutils.errors.DistutilsOptionError: 'extras_require' 选项错误：'foo' 必须是包含有效项目/版本要求说明符的字符串或字符串列表；无效说明符：'>=1.0, <2.0, !=1.5'

- **ID:** `python/setuptools-extras-require-parse-error`
- **领域:** python
- **类别:** config_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

extras_require 条目使用了已安装的 packaging/setuptools 无法解析的说明符集合，常由于多余空格、尾随逗号或重复/冲突的运算符。

## 版本兼容性

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

## 解决方案

1. **** (95% 成功率)
   ```
   Simplify the specifier to a valid PEP 440 set, e.g. `'>=1.0,<2.0,!=1.5'` (no spaces, no trailing comma).
   ```
2. **** (90% 成功率)
   ```
   Validate with `python -c "from packaging.specifiers import SpecifierSet; SpecifierSet('>=1.0,<2.0')"`.
   ```

## 无效尝试

- **** — Whitespace is not the issue; the specifier set itself is malformed. (85% 失败率)
- **** — Shifts the same parse error to a different field. (75% 失败率)
