python
data_error
ai_generated
true
ERROR: Wheel 'numpy-1.26.4-cp311-cp311-manylinux_2_17_x86_64.whl' is invalid: error in <pkg> METADATA: invalid zip file
ID: python/pip-cache-corruption-invalid-wheel
80%Fix Rate
88%Confidence
0Evidence
2024-11-21First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 3.8 | active | — | — | — |
| 3.9 | active | — | — | — |
| 3.10 | active | — | — | — |
| 3.11 | active | — | — | — |
| 3.12 | active | — | — | — |
Root Cause
A previously downloaded wheel in the pip cache is truncated or corrupted, and pip reuses it without re-validating the zip structure.
generic中文
pip 缓存中先前下载的 wheel 被截断或损坏,pip 复用时未重新校验 zip 结构。
Workarounds
-
95% success
Purge the cache and reinstall: `pip cache purge && pip install --no-cache-dir <pkg>`.
-
92% success
Inspect and remove the specific cached wheel: `pip cache list <pkg>` then `pip cache remove <pkg>`.
Dead Ends
Common approaches that don't work:
-
90% fail
Disables index lookup entirely, so pip cannot refetch the corrupted wheel.
-
70% fail
Force-reinstall still consults the cache and can reuse the same corrupted file.