# 错误：'entry_points'必须是一个字典

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

## 根因

setup()中的'entry_points'参数被提供为列表或字符串，而不是字典。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 3.8 | active | — | — |

## 解决方案

1. **Use correct dict format with group keys** (95% 成功率)
   ```
   setup(
    entry_points={
        'console_scripts': ['mycommand=mymodule:main'],
        'myplugin': ['myplugin=mymodule:plugin']
    }
)
   ```
2. **Use setup.cfg for entry points** (90% 成功率)
   ```
   # setup.cfg
[options.entry_points]
console_scripts =
    mycommand = mymodule:main
   ```

## 无效尝试

- **Passing a list of strings** — Setuptools expects nested dict structure; list causes parsing error. (90% 失败率)
- **Omitting entry_points** — Console scripts or plugins will not be registered. (60% 失败率)
