python
config_error
ai_generated
true
错误:未知的发行选项:'entry_points'
error: Unknown distribution option: 'entry_points'
ID: python/setup-py-unknown-distutils-command
80%修复率
85%置信度
0证据数
2024-02-20首次发现
版本兼容性
| 版本 | 状态 | 引入 | 弃用 | 备注 |
|---|---|---|---|---|
| 3.8 | active | — | — | — |
根因分析
较旧的setuptools版本不支持setup.py中的'entry_points';应正确使用'entry_points'。
English
Older setuptools versions do not support 'entry_points' in setup.py; should use 'entry_points' correctly.
解决方案
-
95% 成功率 Upgrade setuptools and use correct syntax
pip install --upgrade setuptools # In setup.py: entry_points={ 'console_scripts': ['mycommand=mymodule:main'] } -
90% 成功率 Use setup.cfg for entry points
# setup.cfg [options.entry_points] console_scripts = mycommand = mymodule:main
无效尝试
常见但无效的做法:
-
Renaming parameter to 'console_scripts'
70% 失败
The correct parameter is 'entry_points' with dict format; renaming breaks functionality.
-
Removing entry_points entirely
60% 失败
Removes console scripts functionality, which may be needed.