python install_error ai_generated true

错误:无效的归档格式:/tmp/pip-install-xxx/package.tar.gz

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

ID: python/pip-invalid-archive-format

其他格式: JSON · Markdown 中文 · English
80%修复率
85%置信度
0证据数
2024-11-01首次发现

版本兼容性

版本状态引入弃用备注
3.9 active

根因分析

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

English

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

generic

解决方案

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

无效尝试

常见但无效的做法:

  1. Re-running pip without cache 70% 失败

    Redownloads same corrupted file from mirror if issue persists.

  2. Manually extracting archive 90% 失败

    Archive is corrupt; extraction fails.