python install_error ai_generated true

ERROR: Invalid archive format: /tmp/pip-install-xxx/package.tar.gz

ID: python/pip-invalid-archive-format

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

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
3.9 active

Root Cause

The downloaded package archive is corrupted or not a valid tar.gz file.

generic

中文

下载的包归档文件损坏或不是有效的tar.gz文件。

Workarounds

  1. 85% success Clear pip cache and retry with different index
    pip cache purge
    pip install package -i https://pypi.org/simple/
  2. 80% success Download and install from a local wheel
    pip download package
    pip install ./package.whl

Dead Ends

Common approaches that don't work:

  1. Re-running pip without cache 70% fail

    Redownloads same corrupted file from mirror if issue persists.

  2. Manually extracting archive 90% fail

    Archive is corrupt; extraction fails.