{
  "id": "pip/cache-corruption-json-decode-error",
  "signature": "ERROR: Exception: Traceback (most recent call last): ... json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0). The cache entry for 'https://pypi.org/simple/package/' is corrupted. Try deleting the cache with 'pip cache purge'.",
  "signature_zh": "错误：异常：回溯（最近一次调用最后）：... json.decoder.JSONDecodeError：期望值：第 1 行第 1 列（字符 0）。'https://pypi.org/simple/package/' 的缓存条目已损坏。尝试使用 'pip cache purge' 删除缓存。",
  "regex": "json\\.decoder\\.JSONDecodeError.*cache entry.*corrupted.*pip cache purge",
  "domain": "pip",
  "category": "data_error",
  "subcategory": null,
  "root_cause": "The pip HTTP cache for the package index has a corrupted JSON file, likely due to an interrupted download or disk write error, causing pip to fail when parsing the cached response.",
  "root_cause_type": "generic",
  "root_cause_zh": "软件包索引的 pip HTTP 缓存存在损坏的 JSON 文件，可能是由于下载中断或磁盘写入错误导致，使 pip 在解析缓存的响应时失败。",
  "versions": [
    {
      "version": "pip 23.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "pip 23.1",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "pip 23.2",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "pip 24.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Manually editing the cache JSON file to fix the corruption",
      "why_fails": "The cache file is often binary or partially written; manual editing is unreliable and may introduce further corruption.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "Using pip install --no-cache-dir once but expecting the cache to be automatically repaired",
      "why_fails": "--no-cache-dir bypasses the cache for the current install but does not remove the corrupted entry; subsequent pip commands will still fail.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "Deleting only the specific cache file without understanding the cache directory structure",
      "why_fails": "The cache may have multiple corrupted entries across different packages; a targeted delete may miss some.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Clear the entire pip HTTP cache: pip cache purge. Then retry the installation. This removes all cached package index responses.",
      "success_rate": 0.95,
      "how": "Clear the entire pip HTTP cache: pip cache purge. Then retry the installation. This removes all cached package index responses.",
      "condition": "",
      "sources": []
    },
    {
      "action": "If pip cache purge fails due to permission issues, manually delete the cache directory: rm -rf ~/.cache/pip (Linux/macOS) or rmdir /s %LocalAppData%\\pip\\cache (Windows). Then retry.",
      "success_rate": 0.9,
      "how": "If pip cache purge fails due to permission issues, manually delete the cache directory: rm -rf ~/.cache/pip (Linux/macOS) or rmdir /s %LocalAppData%\\pip\\cache (Windows). Then retry.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use pip install --no-cache-dir as a temporary workaround to bypass the cache entirely: pip install --no-cache-dir package",
      "success_rate": 0.8,
      "how": "Use pip install --no-cache-dir as a temporary workaround to bypass the cache entirely: pip install --no-cache-dir package",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "清除整个 pip HTTP 缓存：pip cache purge。然后重试安装。这将删除所有缓存的软件包索引响应。",
    "如果 pip cache purge 因权限问题失败，请手动删除缓存目录：rm -rf ~/.cache/pip（Linux/macOS）或 rmdir /s %LocalAppData%\\pip\\cache（Windows）。然后重试。",
    "使用 pip install --no-cache-dir 作为临时解决方法，完全绕过缓存：pip install --no-cache-dir package"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://pip.pypa.io/en/stable/topics/caching/",
  "official_doc_section": null,
  "error_code": "ERROR",
  "verification_tier": "ai_generated",
  "confidence": 0.9,
  "fix_success_rate": 0.95,
  "resolvable": "true",
  "first_seen": "2023-07-22",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}