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

- **ID:** `python/pip-invalid-archive-format`
- **领域:** python
- **类别:** install_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

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

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 3.9 | active | — | — |

## 解决方案

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

## 无效尝试

- **Re-running pip without cache** — Redownloads same corrupted file from mirror if issue persists. (70% 失败率)
- **Manually extracting archive** — Archive is corrupt; extraction fails. (90% 失败率)
