{
  "id": "python/pip-egg-info-attribute-error",
  "signature": "AttributeError: module 'setuptools' has no attribute 'setup'",
  "signature_zh": "AttributeError: 模块'setuptools'没有属性'setup'",
  "regex": "AttributeError:\\ module\\ 'setuptools'\\ has\\ no\\ attribute\\ 'setup'",
  "domain": "python",
  "category": "module_error",
  "subcategory": null,
  "root_cause": "Incorrect import statement or shadowed module name. Often caused by a local file named 'setuptools.py' or importing setuptools incorrectly after a partial installation.",
  "root_cause_type": "generic",
  "root_cause_zh": "导入语句错误或模块名被遮蔽。通常由本地文件名为'setuptools.py'或在部分安装后错误导入setuptools引起。",
  "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": "",
      "why_fails": "If a local setuptools.py file exists in the working directory, it shadows the real package regardless of reinstallation.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Wildcard imports can hide the actual attribute if the module namespace is polluted or if there's a circular import.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.9,
      "how": "Check for and rename local setuptools.py, then run: python -c \"import setuptools; print(setuptools.__file__)\"",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.8,
      "how": "Explicitly import: import setuptools; setuptools.setup()",
      "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": "2024-03-15",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}