{
  "id": "python/pip-cache-directory-not-writable",
  "signature": "WARNING: The directory '/home/user/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled.",
  "signature_zh": "警告：目录 '/home/user/.cache/pip' 或其父目录不属于当前用户或不可写。缓存已被禁用。",
  "regex": "WARNING:\\ The\\ directory\\ '/home/user/\\.cache/pip'\\ or\\ its\\ parent\\ directory\\ is\\ not\\ owned\\ or\\ is\\ not\\ writable\\ by\\ the\\ current\\ user\\.\\ The\\ cache\\ has\\ been\\ disabled\\.",
  "domain": "python",
  "category": "system_error",
  "subcategory": null,
  "root_cause": "The pip cache directory was created by another user (often root from a prior sudo pip run) or has restrictive permissions, so pip cannot write to it and disables caching.",
  "root_cause_type": "generic",
  "root_cause_zh": "pip 缓存目录由其他用户（通常是之前 sudo pip 运行的 root）创建，或权限受限，因此 pip 无法写入并禁用缓存。",
  "versions": [
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Silences the warning by skipping cache entirely but leaves the root-owned directory in place; every future install re-warns.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Makes root the owner again, guaranteeing the non-root user still cannot write; the warning persists.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.92,
      "how": "Reclaim ownership: sudo chown -R $USER:$USER ~/.cache/pip",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "Point the cache elsewhere: pip config set global.cache-dir ~/.cache/pip-user  # or export PIP_CACHE_DIR=~/.cache/pip-user",
      "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": []
}