python config_error ai_generated true

error: Error in setup.cfg: entry_points must be a dictionary, not a list

ID: python/setuptools-entry-point-error

Also available as: JSON · Markdown · 中文
80%Fix Rate
85%Confidence
0Evidence
2025-08-10First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
3.8 active
3.9 active
3.10 active
3.11 active
3.12 active

Root Cause

The entry_points configuration in setup.cfg is incorrectly formatted as a list instead of a dictionary.

generic

中文

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

Workarounds

  1. 95% success Format entry_points as a dictionary in setup.cfg
    [options.entry_points]
    console_scripts =
        mycommand = mypackage.module:function
  2. 90% success Define entry_points in setup.py as a dict
    entry_points={'console_scripts': ['mycommand=mypackage.module:function']}

Dead Ends

Common approaches that don't work:

  1. Converting to a list of strings 90% fail

    setuptools expects a dict with console_scripts keys.

  2. Omitting entry_points entirely 70% fail

    This removes the feature but may break expected CLI commands.