{
  "id": "python/pip-no-such-file-or-directory",
  "signature": "ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: '/usr/local/lib/python3.11/site-packages/setuptools-*.dist-info'",
  "signature_zh": "错误：由于OSError无法安装包：[Errno 2] 没有那个文件或目录：'/usr/local/lib/python3.11/site-packages/setuptools-*.dist-info'",
  "regex": "ERROR:\\ Could\\ not\\ install\\ packages\\ due\\ to\\ an\\ OSError:\\ \\[Errno\\ 2\\]\\ No\\ such\\ file\\ or\\ directory:\\ '/usr/local/lib/python3\\.11/site\\-packages/setuptools\\-\\*\\.dist\\-info'",
  "domain": "python",
  "category": "install_error",
  "subcategory": null,
  "root_cause": "Pip's build isolation tries to install setuptools into a temporary directory, but the path contains a wildcard or the directory is missing due to a corrupted pip cache or partial uninstall.",
  "root_cause_type": "generic",
  "root_cause_zh": "Pip的构建隔离尝试将setuptools安装到临时目录，但路径包含通配符或目录因pip缓存损坏或部分卸载而缺失。",
  "versions": [
    {
      "version": "3.11",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Clears cache but doesn't fix the underlying file system corruption or missing directory.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Directory may not exist; pip recreates the same broken path due to stale metadata.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Forces reinstall but still uses the same broken temp path.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.8,
      "how": "pip cache purge && pip install --no-build-isolation somepackage",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.75,
      "how": "mkdir -p /usr/local/lib/python3.11/site-packages && touch /usr/local/lib/python3.11/site-packages/setuptools.dist-info",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "python -m venv venv && source venv/bin/activate && pip install somepackage",
      "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-02-15",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}