{
  "id": "python/setuptools-extras-require-error",
  "signature": "error: In setup.cfg: 'extras_require' must be a dictionary, not a string",
  "signature_zh": "错误：在 setup.cfg 中：'extras_require' 必须是字典，而不是字符串",
  "regex": "error:\\ In\\ setup\\.cfg:\\ 'extras_require'\\ must\\ be\\ a\\ dictionary,\\ not\\ a\\ string",
  "domain": "python",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "The extras_require configuration is incorrectly set as a plain string instead of a dictionary mapping.",
  "root_cause_type": "generic",
  "root_cause_zh": "extras_require 配置错误地设置为纯字符串，而不是字典映射。",
  "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"
    },
    {
      "version": "3.11",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.12",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Setting extras_require as a list",
      "why_fails": "setuptools expects a dict with extra names as keys.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "Omitting extras_require",
      "why_fails": "This removes optional dependencies but may be acceptable.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Format extras_require as a dictionary in setup.cfg",
      "success_rate": 0.95,
      "how": "[options.extras_require]\ntest =\n    pytest\n    pytest-cov",
      "condition": "",
      "sources": []
    },
    {
      "action": "Define extras_require in setup.py as a dict",
      "success_rate": 0.9,
      "how": "extras_require={'test': ['pytest', 'pytest-cov']}",
      "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.85,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2026-02-28",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}