python
data_error
ai_generated
true
错误:无效存档:/path/to/package.tar.gz - 不是有效的 gzip 文件
ERROR: Invalid archive: /path/to/package.tar.gz - Not a valid gzip file
ID: python/pip-invalid-archive
80%修复率
85%置信度
0证据数
2024-11-09首次发现
版本兼容性
| 版本 | 状态 | 引入 | 弃用 | 备注 |
|---|---|---|---|---|
| 3.8 | active | — | — | — |
| 3.9 | active | — | — | — |
根因分析
下载的存档已损坏或不是预期的 gzip 格式。
English
The downloaded archive is corrupted or not in the expected gzip format.
解决方案
-
85% 成功率 Download the package from an alternative source
Use a different PyPI mirror: pip install -i https://pypi.org/simple/ package
-
80% 成功率 Clear pip cache and retry
Run: pip cache purge; then pip install package
无效尝试
常见但无效的做法:
-
Re-downloading the same file from the same source
80% 失败
If the source is corrupted, re-downloading won't help.
-
Using a different decompression tool like 7zip
90% 失败
The file itself is invalid, not a decompression issue.