{
  "id": "python/setuptools-pkg-resources-deprecation-warning",
  "signature": "DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html",
  "signature_zh": "弃用警告：pkg_resources 作为 API 已弃用。请参阅 https://setuptools.pypa.io/en/latest/pkg_resources.html",
  "regex": "DeprecationWarning:\\ pkg_resources\\ is\\ deprecated\\ as\\ an\\ API\\.\\ See\\ https://setuptools\\.pypa\\.io/en/latest/pkg_resources\\.html",
  "domain": "python",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "The pkg_resources module from setuptools is deprecated and will be removed in future versions. Code or dependencies still import it, triggering the warning.",
  "root_cause_type": "generic",
  "root_cause_zh": "setuptools 中的 pkg_resources 模块已被弃用，并将在未来版本中移除。代码或依赖项仍在导入它，从而触发警告。",
  "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": "Hides the warning but does not fix the underlying deprecated usage; future removal will break the code.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Temporary workaround but loses security fixes and new features; not sustainable.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.85,
      "how": "Replace pkg_resources usage with importlib.metadata and importlib.resources from the standard library.",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.8,
      "how": "If the warning comes from a third-party package, update it to the latest version that no longer uses pkg_resources.",
      "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.86,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-05-12",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}