python data_error ai_generated true

ERROR: Invalid archive: /path/to/package.tar.gz - Not a valid gzip file

ID: python/pip-invalid-archive

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

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
3.8 active
3.9 active

Root Cause

The downloaded archive is corrupted or not in the expected gzip format.

generic

中文

下载的存档已损坏或不是预期的 gzip 格式。

Workarounds

  1. 85% success Download the package from an alternative source
    Use a different PyPI mirror: pip install -i https://pypi.org/simple/ package
  2. 80% success Clear pip cache and retry
    Run: pip cache purge; then pip install package

Dead Ends

Common approaches that don't work:

  1. Re-downloading the same file from the same source 80% fail

    If the source is corrupted, re-downloading won't help.

  2. Using a different decompression tool like 7zip 90% fail

    The file itself is invalid, not a decompression issue.