{
  "id": "python/setuptools-package-discovery-failed",
  "signature": "error: package directory 'mypackage' does not exist",
  "signature_zh": "错误：包目录 'mypackage' 不存在",
  "regex": "error:\\ package\\ directory\\ 'mypackage'\\ does\\ not\\ exist",
  "domain": "python",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "setuptools cannot find the package directory specified in setup.py's packages or package_dir argument. This happens when the directory name is misspelled or the package structure is incorrect.",
  "root_cause_type": "generic",
  "root_cause_zh": "setuptools 找不到 setup.py 中 packages 或 package_dir 参数指定的包目录。这发生在目录名拼写错误或包结构不正确时。",
  "versions": [
    {
      "version": "3.7",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "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"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "The package won't contain the intended modules, leading to import errors at runtime.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "setuptools may not include any packages, resulting in an empty distribution.",
      "fail_rate": 0.75,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "Verify the package directory exists and matches the name in setup.py. Use find_packages() to automatically discover packages.",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "If using src layout, specify package_dir={'': 'src'} and ensure the directory structure is correct.",
      "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.87,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2025-08-15",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}