{
  "id": "python/pip-egg-info-dir-error",
  "signature": "ERROR: Could not install packages due to an EnvironmentError: [Errno 39] Directory not empty: '.../src/package.egg-info'",
  "signature_zh": "错误：由于环境错误无法安装包：[Errno 39] 目录非空：'.../src/package.egg-info'",
  "regex": "ERROR:\\ Could\\ not\\ install\\ packages\\ due\\ to\\ an\\ EnvironmentError:\\ \\[Errno\\ 39\\]\\ Directory\\ not\\ empty:\\ '\\.\\.\\./src/package\\.egg\\-info'",
  "domain": "python",
  "category": "system_error",
  "subcategory": null,
  "root_cause": "A stale .egg-info directory exists from a previous build, and pip's cleanup fails because the directory is not empty.",
  "root_cause_type": "generic",
  "root_cause_zh": "先前构建留下的过时 .egg-info 目录，pip 清理失败因为目录非空。",
  "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"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Deleting the .egg-info directory manually but not the contents",
      "why_fails": "If the directory is not fully removed, pip may still detect it and fail.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    },
    {
      "action": "Running pip with `--no-clean`",
      "why_fails": "This flag skips cleanup after installation, but the error occurs during the build step, not after.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Manually remove the .egg-info directory and its contents",
      "success_rate": 0.95,
      "how": "`rm -rf src/package.egg-info` then re-run `pip install .`",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use `pip install --no-build-isolation` to avoid build isolation issues",
      "success_rate": 0.8,
      "how": "`pip install --no-build-isolation .`",
      "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.84,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-09-14",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}