# 错误：setup.cfg 中的错误：entry_points 必须是字典，而不是列表

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

## 根因

setup.cfg 中的 entry_points 配置格式错误，应为字典而非列表。

## 版本兼容性

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

## 解决方案

1. **Format entry_points as a dictionary in setup.cfg** (95% 成功率)
   ```
   [options.entry_points]
console_scripts =
    mycommand = mypackage.module:function
   ```
2. **Define entry_points in setup.py as a dict** (90% 成功率)
   ```
   entry_points={'console_scripts': ['mycommand=mypackage.module:function']}
   ```

## 无效尝试

- **Converting to a list of strings** — setuptools expects a dict with console_scripts keys. (90% 失败率)
- **Omitting entry_points entirely** — This removes the feature but may break expected CLI commands. (70% 失败率)
