{
  "id": "python/pip-cache-write-permission-denied",
  "signature": "WARNING: Cache entry deserialization failed, entry ignored\nERROR: Could not install packages due to an OSError: [Errno 13] Permission denied: '/root/.cache/pip/http-v2/...'",
  "signature_zh": "警告：缓存条目反序列化失败，条目被忽略\n错误：由于 OSError: [Errno 13] 权限被拒绝：'/root/.cache/pip/http-v2/...'，无法安装包。",
  "regex": "WARNING:\\ Cache\\ entry\\ deserialization\\ failed,\\ entry\\ ignored\\\nERROR:\\ Could\\ not\\ install\\ packages\\ due\\ to\\ an\\ OSError:\\ \\[Errno\\ 13\\]\\ Permission\\ denied:\\ '/root/\\.cache/pip/http\\-v2/\\.\\.\\.'",
  "domain": "python",
  "category": "system_error",
  "subcategory": null,
  "root_cause": "pip is running as a different user than the one that owns the pip cache directory, or the cache was created by root and now a non-root user tries to write to it.",
  "root_cause_type": "generic",
  "root_cause_zh": "pip 运行的用户与拥有 pip 缓存目录的用户不同，或缓存由 root 创建，现在非 root 用户尝试写入。",
  "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": "Running as root fixes the immediate error but pollutes site-packages and can break the system Python.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "World-writable cache is a security risk and may still fail if the parent dir is not writable.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.9,
      "how": "Fix ownership or use a user-local cache:\n  sudo chown -R $USER:$USER ~/.cache/pip\nOr:\n  export PIP_CACHE_DIR=$HOME/.cache/pip-user\n  mkdir -p $PIP_CACHE_DIR\n  pip install <package>",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "Bypass the cache entirely for this install:\n  pip install --no-cache-dir <package>",
      "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-06-04",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}