{
  "id": "python/pip-no-space-left-on-device",
  "signature": "ERROR: Could not install packages due to an OSError: [Errno 28] No space left on device",
  "signature_zh": "错误：由于 OSError 无法安装包：[Errno 28] 设备上没有剩余空间",
  "regex": "ERROR:\\ Could\\ not\\ install\\ packages\\ due\\ to\\ an\\ OSError:\\ \\[Errno\\ 28\\]\\ No\\ space\\ left\\ on\\ device",
  "domain": "python",
  "category": "system_error",
  "subcategory": null,
  "root_cause": "The filesystem hosting the pip cache or the target site-packages has run out of space, often after many wheel downloads accumulate in ~/.cache/pip.",
  "root_cause_type": "generic",
  "root_cause_zh": "承载 pip 缓存或目标 site-packages 的文件系统空间已耗尽，通常是由于 ~/.cache/pip 中积累了大量 wheel 下载。",
  "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": "Avoids new cache writes but the target site-packages still needs space and may be on the same full volume.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Upgrading pip itself needs space and does not free any.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "pip cache purge\n# or manually\nrm -rf ~/.cache/pip\ndf -h ~\npip install somepkg",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "export PIP_CACHE_DIR=/mnt/bigdisk/pip-cache\npip install somepkg\n# or persist it\npip config set global.cache-dir /mnt/bigdisk/pip-cache",
      "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-09-25",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}