# 错误：未知的发行选项：'entry_points'

- **ID:** `python/setup-py-unknown-distutils-command`
- **领域:** python
- **类别:** config_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

较旧的setuptools版本不支持setup.py中的'entry_points'；应正确使用'entry_points'。

## 版本兼容性

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

## 解决方案

1. **Upgrade setuptools and use correct syntax** (95% 成功率)
   ```
   pip install --upgrade setuptools
# In setup.py:
entry_points={
    'console_scripts': ['mycommand=mymodule:main']
}
   ```
2. **Use setup.cfg for entry points** (90% 成功率)
   ```
   # setup.cfg
[options.entry_points]
console_scripts =
    mycommand = mymodule:main
   ```

## 无效尝试

- **Renaming parameter to 'console_scripts'** — The correct parameter is 'entry_points' with dict format; renaming breaks functionality. (70% 失败率)
- **Removing entry_points entirely** — Removes console scripts functionality, which may be needed. (60% 失败率)
