# 错误：由于 ZipError 无法安装包：[Errno 2] 没有那个文件或目录: '/path/to/package.whl'

- **ID:** `pip/zip-deflate-error`
- **领域:** pip
- **类别:** data_error
- **错误码:** `ERROR`
- **验证级别:** ai_generated
- **修复率:** 85%

## 根因

pip 在安装过程中遇到损坏或不完整的 .whl 文件，通常由下载中断或文件系统问题（如磁盘满或坏扇区）引起。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| pip 23.1 | active | — | — |
| pip 24.0 | active | — | — |
| Python 3.10 | active | — | — |
| Python 3.11 | active | — | — |

## 解决方案

1. ```
   Clear pip's cache and re-download: pip cache purge && pip install package --no-cache-dir
   ```
2. ```
   Manually delete the specific .whl file from pip's cache directory: rm -rf ~/.cache/pip/http/* && pip install package
   ```
3. ```
   If the disk is full, free up space: df -h . && rm -rf /tmp/pip-* && pip install package
   ```

## 无效尝试

- **** — Running pip install --no-cache-dir does not fix the corrupted .whl; it only bypasses the cache but the download may still be corrupt. (70% 失败率)
- **** — Using pip install --force-reinstall only re-downloads the same corrupted wheel if the source is bad. (85% 失败率)
- **** — Setting PIP_REQUIRE_VIRTUALENV does not address the file corruption; it's unrelated to disk or download issues. (95% 失败率)
