{
  "id": "python/setuptools-entry-points-error",
  "signature": "TypeError: entry_points() got an unexpected keyword argument 'console_scripts'",
  "signature_zh": "TypeError：entry_points() 得到了意外的关键字参数 'console_scripts'",
  "regex": "TypeError:\\ entry_points\\(\\)\\ got\\ an\\ unexpected\\ keyword\\ argument\\ 'console_scripts'",
  "domain": "python",
  "category": "type_error",
  "subcategory": null,
  "root_cause": "Incorrect use of entry_points parameter in setup.py; console_scripts should be a key in a dictionary, not a separate argument.",
  "root_cause_type": "generic",
  "root_cause_zh": "在 setup.py 中错误使用 entry_points 参数；console_scripts 应该是字典中的一个键，而不是单独的参数。",
  "versions": [
    {
      "version": "3.8",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.9",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.10",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Passing console_scripts as a list directly to setup()",
      "why_fails": "setup() expects entry_points as a dict; console_scripts is not a valid top-level parameter.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "Removing entry_points entirely",
      "why_fails": "This removes the command-line scripts, which may be required for the package's functionality.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Correctly structure entry_points as a dictionary",
      "success_rate": 0.95,
      "how": "`setup(..., entry_points={'console_scripts': ['mycmd=mymodule:main']})`",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use pyproject.toml with [project.scripts] instead",
      "success_rate": 0.9,
      "how": "In pyproject.toml: `[project.scripts]\nmycmd = \"mymodule:main\"`",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": null,
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.84,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-03-22",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}