python config_error ai_generated true

error: 'entry_points' must be a dictionary

ID: python/setuptools-entry-points-format

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

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
3.8 active

Root Cause

The 'entry_points' argument in setup() was provided as a list or string instead of a dict.

generic

中文

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

Workarounds

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

Dead Ends

Common approaches that don't work:

  1. Passing a list of strings 90% fail

    Setuptools expects nested dict structure; list causes parsing error.

  2. Omitting entry_points 60% fail

    Console scripts or plugins will not be registered.