{
  "id": "python/setuptools-pkg-resources-not-found",
  "signature": "ModuleNotFoundError: No module named 'pkg_resources'",
  "signature_zh": "ModuleNotFoundError: 没有名为 'pkg_resources' 的模块",
  "regex": "ModuleNotFoundError:\\ No\\ module\\ named\\ 'pkg_resources'",
  "domain": "python",
  "category": "module_error",
  "subcategory": null,
  "root_cause": "pkg_resources is part of setuptools, but the installed setuptools version is too old or missing.",
  "root_cause_type": "generic",
  "root_cause_zh": "pkg_resources 是 setuptools 的一部分，但安装的 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": "Installing pkg_resources separately from PyPI",
      "why_fails": "pkg_resources is not a standalone package; it comes with setuptools.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "Using importlib.resources instead",
      "why_fails": "This is a different API and may not be compatible with existing code.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Upgrade or reinstall setuptools",
      "success_rate": 0.95,
      "how": "pip install --upgrade setuptools",
      "condition": "",
      "sources": []
    },
    {
      "action": "Install setuptools in the environment",
      "success_rate": 0.9,
      "how": "python -m pip install setuptools",
      "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-12-01",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}