{
  "id": "python/setuptools-package-dir-not-found",
  "signature": "error: package directory 'src/mypackage' does not exist",
  "signature_zh": "错误：包目录'src/mypackage'不存在",
  "regex": "error:\\ package\\ directory\\ 'src/mypackage'\\ does\\ not\\ exist",
  "domain": "python",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "The directory specified in 'packages' or 'package_dir' does not exist on disk.",
  "root_cause_type": "generic",
  "root_cause_zh": "在'packages'或'package_dir'中指定的目录在磁盘上不存在。",
  "versions": [
    {
      "version": "3.8",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Creating a placeholder __init__.py in wrong location",
      "why_fails": "The directory structure must match exactly; wrong location doesn't fix.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "Removing package_dir entirely",
      "why_fails": "Breaks package discovery; setuptools may look in wrong place.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Create the missing directory with __init__.py",
      "success_rate": 0.95,
      "how": "mkdir -p src/mypackage\ntouch src/mypackage/__init__.py",
      "condition": "",
      "sources": []
    },
    {
      "action": "Update setup.py to match existing structure",
      "success_rate": 0.9,
      "how": "from setuptools import find_packages\nsetup(\n    packages=find_packages(where='src'),\n    package_dir={'': 'src'}\n)",
      "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-05-12",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}