ERROR pip cache_error ai_generated true

ERROR: The cache entry is corrupted: hash mismatch for cached file

ID: pip/cache-corruption

Also available as: JSON · Markdown
95%Fix Rate
95%Confidence
50Evidence
2022-06-01First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
24 active

Root Cause

Pip's local cache contains corrupted files, usually from interrupted downloads, disk errors, or running out of space during caching. Cached wheels or sdists fail integrity checks when pip tries to reuse them.

generic

Workarounds

  1. 95% success Purge pip cache completely: pip cache purge
    pip cache purge && pip install <package>
  2. 92% success Use --no-cache-dir for the immediate install, then purge cache later
    pip install --no-cache-dir <package>
  3. 90% success Remove specific cached package: pip cache remove <package>
    pip cache remove <package> && pip install <package>

Dead Ends

Common approaches that don't work:

  1. Manually edit or patch cached files 95% fail

    Cached files are compressed archives with checksums; manual editing breaks integrity and pip will still reject them

  2. Change cache directory without clearing the old one 50% fail

    Does not fix the root cause; if disk issues caused corruption, the new cache may also become corrupted

Error Chain

Leads to:
Preceded by:
Frequently confused with: