# 错误：'extras_require' 必须是一个字典，其值为字符串或字符串列表，包含有效的项目/版本需求说明符。

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

## 根因

setup.py 中的 extras_require 字典包含无效的需求说明符或非字符串值。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 3.x | active | — | — |

## 解决方案

1. **** (95% 成功率)
   ```
   extras_require={'dev': ['pytest>=6.0', 'flake8']}
   ```
2. **** (92% 成功率)
   ```
   [project.optional-dependencies]\ndev = ['pytest>=6.0', 'flake8']
   ```

## 无效尝试

- **** — Loses optional dependency functionality; not a proper fix if extras are needed. (80% 失败率)
- **** — setuptools will not proceed with invalid metadata; build fails. (90% 失败率)
