python
data_error
ai_generated
true
ERROR: Exception: Traceback (most recent call last): ... zipfile.BadZipFile: File is not a zip file
ID: python/pip-cache-corrupted-unexpected-eof
80%Fix Rate
87%Confidence
0Evidence
2024-02-20First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 3.7 | active | — | — | — |
| 3.8 | active | — | — | — |
| 3.9 | active | — | — | — |
| 3.10 | active | — | — | — |
| 3.11 | active | — | — | — |
| 3.12 | active | — | — | — |
Root Cause
pip's HTTP cache or wheel cache contains a corrupted download, often due to interrupted network transfer or disk write errors. pip attempts to read the cached file as a zip archive but fails.
generic中文
pip 的 HTTP 缓存或 wheel 缓存中包含损坏的下载文件,通常是由于网络传输中断或磁盘写入错误导致。pip 尝试将缓存文件作为 zip 归档读取时失败。
Workarounds
-
95% success
Clear pip's cache: pip cache purge, then retry the installation.
-
90% success
Bypass cache for a single install: pip install --no-cache-dir <package>.
Dead Ends
Common approaches that don't work:
-
80% fail
Reinstalling pip does not clear the corrupted cache; the bad file remains and will be reused.
-
75% fail
Force reinstall still reads from cache first; corrupted cache causes the same error.