{
  "id": "python/pip-egg-info-directory-shadow",
  "signature": "error: Multiple top-level packages discovered in a flat-layout: ['src', 'tests', 'docs'].",
  "signature_zh": "错误：在扁平布局中发现多个顶级包：['src', 'tests', 'docs']。",
  "regex": "error:\\ Multiple\\ top\\-level\\ packages\\ discovered\\ in\\ a\\ flat\\-layout:\\ \\['src',\\ 'tests',\\ 'docs'\\]\\.",
  "domain": "python",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "setuptools auto-discovery in a flat project layout finds multiple candidate top-level packages and refuses to guess which one is the distribution.",
  "root_cause_type": "generic",
  "root_cause_zh": "在扁平项目布局中，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": "The error is from setuptools discovery, not isolation; the same 'Multiple top-level packages' error occurs.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Hides one symptom but src/ and docs/ still trigger the error; brittle workaround.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "cat > pyproject.toml <<'TOML'\n[build-system]\nrequires = [\"setuptools>=68\"]\nbuild-backend = \"setuptools.build_meta\"\n\n[project]\nname = \"mypkg\"\nversion = \"0.1.0\"\n\n[tool.setuptools.packages.find]\nwhere = [\"src\"]\nTOML\npip install .",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "mkdir -p src/mypkg\nmv mypkg/* src/mypkg/\n# ensure pyproject.toml uses [tool.setuptools.packages.find] where=[\"src\"]\npip install .",
      "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.88,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-10-03",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}