{
  "id": "python/pip-cache-permission-denied",
  "signature": "ERROR: Could not install packages due to an OSError: [Errno 13] Permission denied: '/root/.cache/pip'",
  "signature_zh": "错误：由于 OSError 无法安装包：[Errno 13] 权限被拒绝：'/root/.cache/pip'",
  "regex": "ERROR:\\ Could\\ not\\ install\\ packages\\ due\\ to\\ an\\ OSError:\\ \\[Errno\\ 13\\]\\ Permission\\ denied:\\ '/root/\\.cache/pip'",
  "domain": "python",
  "category": "system_error",
  "subcategory": null,
  "root_cause": "pip is running as a user without write access to the cache directory, often because the cache was created by root or another user.",
  "root_cause_type": "generic",
  "root_cause_zh": "pip 以无权写入缓存目录的用户身份运行，通常是因为缓存由 root 或其他用户创建。",
  "versions": [
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Installs packages system-wide and may cause permission issues later; not recommended in virtualenvs.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "If you lack permission to delete it, the error persists; also loses cache benefits.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "pip install --cache-dir /tmp/pip-cache package",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "sudo chown -R $USER:$USER ~/.cache/pip",
      "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-04-18",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}