Error Knowledge Base PIP CACHE_DESERIALIZATION_FAILED

Cache entry deserialization failed, entry ignored

pip detected a corrupted or incompatible cache entry and ignored it. Installs may be slower or may fail if corruption is widespread.

Affected versions: All pip versions that read pip's cache formats.

What This Error Means

pip detected a corrupted or incompatible cache entry and ignored it. Installs may be slower or may fail if corruption is widespread.

How to Fix It

  1. Clear cache: python -m pip cache purge.
  2. Retry with --no-cache-dir to bypass caching temporarily.
  3. If the issue recurs, ensure you have enough disk space and check filesystem health.

Why It Happens

  • A prior pip run was interrupted while writing cache entries.
  • Disk issues (full disk, filesystem errors) corrupted cached files.
  • Cache format changed across pip versions and old entries are no longer readable.

How to Verify

  1. Re-run the install and confirm cache warnings are gone (or reduced).
  2. Confirm installs succeed and are stable across retries.

Manual cache cleanup

  1. Check your disk for errors and free space (cache corruption can be a symptom).
  2. Check where pip cache is stored: python -m pip cache dir.

Common CLI Output

Cache entry deserialization failed, entry ignored

What pip caches

  1. pip caches downloaded artifacts and some metadata to speed up future installs.
  2. If the cache is corrupted (due to interrupted writes, disk issues, or format changes), pip may warn and ignore entries.
  3. Inconsistent caches can also contribute to confusing network/download errors.

Prevention Tips

  • Avoid killing pip mid-install in CI (allow it to finish writing caches).
  • Ensure adequate disk space for pip cache/temp directories.
  • Pin pip versions in CI if cache format changes cause issues.

Where This Can Be Triggered

github.com/pypa/pip/blob/25.3/src/pip/_vendor/cachecontrol/controller.py

pip (via its vendored CacheControl) emits this warning when a cached response cannot be deserialized and is ignored. - GitHub

    def _load_from_cache(self, request: PreparedRequest) -> HTTPResponse | None:
        """
        Load a cached response, or return None if it's not available.
        """
        # We do not support caching of partial content: so if the request contains a
        # Range header then we don't want to load anything from the cache.
        if "Range" in request.headers:
            return None

        cache_url = request.url
        assert cache_url is not None
        cache_data = self.cache.get(cache_url)
        if cache_data is None:
            logger.debug("No cache entry available")
            return None

        if isinstance(self.cache, SeparateBodyBaseCache):
            body_file = self.cache.get_body(cache_url)
        else:
            body_file = None

        result = self.serializer.loads(request, cache_data, body_file)
        if result is None:
            logger.warning("Cache entry deserialization failed, entry ignored")
        return result

Need help or found a mistake? Contact RepoFlow support for questions.

Join our mailing list