{
  "id": "python/pip-hash-mismatch-downloaded-wheel",
  "signature": "ERROR: THESE PACKAGES DO NOT MATCH THE HASHES FROM THE REQUIREMENTS FILE. If you have updated the package versions, please update the hashes.\n    Expected sha256 3f7a...\n         Got        a91c...",
  "signature_zh": "错误：这些包与 requirements 文件中的哈希不匹配。如果已更新包版本，请更新哈希值。",
  "regex": "ERROR:\\ THESE\\ PACKAGES\\ DO\\ NOT\\ MATCH\\ THE\\ HASHES\\ FROM\\ THE\\ REQUIREMENTS\\ FILE\\.\\ If\\ you\\ have\\ updated\\ the\\ package\\ versions,\\ please\\ update\\ the\\ hashes\\.\\\n\\ \\ \\ \\ Expected\\ sha256\\ 3f7a\\.\\.\\.\\\n\\ \\ \\ \\ \\ \\ \\ \\ \\ Got\\ \\ \\ \\ \\ \\ \\ \\ a91c\\.\\.\\.",
  "domain": "python",
  "category": "install_error",
  "subcategory": null,
  "root_cause": "A `--hash` pin in requirements.txt does not match the hash of the downloaded artifact. Causes: package was re-uploaded, hash was computed on a different wheel (platform tag), or the artifact was tampered with.",
  "root_cause_type": "generic",
  "root_cause_zh": "requirements.txt 中的 `--hash` 固定值与下载产物的哈希不匹配。原因：包被重新上传、哈希基于不同 wheel（平台标签）计算，或产物被篡改。",
  "versions": [
    {
      "version": "pip>=21.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "pip still enforces --hash pins; --no-deps and --ignore-installed do not bypass hash verification.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Removes supply-chain protection and defeats the purpose of the pinned hash; acceptable only as a temporary local debug step.",
      "fail_rate": 0.4,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.9,
      "how": "Regenerate hashes for the exact artifacts you intend to install:\n\npip download --no-deps --dest /tmp/wheels <pkg>==<ver>\npip hash /tmp/wheels/<pkg>-<ver>-*.whl\n\nUpdate requirements.txt with the new sha256.",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "Use pip-tools to keep hashes in sync automatically:\n\npip install pip-tools\npip-compile --generate-hashes requirements.in\npip-sync requirements.txt",
      "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-07-22",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}