python install_error ai_generated true

ERROR: THESE PACKAGES DO NOT MATCH THE HASHES FROM THE REQUIREMENTS FILE. If you have updated the package versions, please update the hashes.

ID: python/pip-invalid-requirement-hash-mismatch

Also available as: JSON · Markdown · 中文
80%Fix Rate
90%Confidence
0Evidence
2024-05-09First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
3.8 active — — —
3.9 active — — —
3.10 active — — —
3.11 active — — —
3.12 active — — —

Root Cause

The downloaded wheel/sdist SHA256 does not match the hash pinned in requirements.txt, either because the file was re-uploaded, the mirror serves a different build, or the hash line is stale.

generic

中文

下载的 wheel/sdist 的 SHA256 与 requirements.txt 中固定的哈希不匹配,可能是因为文件被重新上传、镜像提供不同的构建,或哈希行已过期。

Workarounds

  1. 95% success
    Regenerate the hashes with pip-tools:
      pip install pip-tools
      pip-compile --generate-hashes requirements.in
    Then install:
      pip install -r requirements.txt
  2. 90% success
    If you intentionally want to skip hashes temporarily, remove the --hash lines or the --require-hashes flag from the install command.

Dead Ends

Common approaches that don't work:

  1. 90% fail

    --no-deps skips dependency resolution, not hash verification; the check still runs.

  2. 95% fail

    --trusted-host only disables TLS verification, not hash verification.