python
system_error
ai_generated
true
ERROR: Could not install packages due to an OSError: [Errno 28] No space left on device
ID: python/pip-install-error-errno-28-no-space-left-on-device
80%Fix Rate
85%Confidence
0Evidence
2024-03-15First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 3.x | active | — | — | — |
Root Cause
The pip installation fails because the disk partition where pip's cache or site-packages resides has run out of free space. This commonly happens when /tmp or the root filesystem is full.
generic中文
pip 安装失败,因为 pip 缓存或 site-packages 所在磁盘分区空间已满。常见于 /tmp 或根文件系统已满的情况。
Workarounds
-
95% success
pip cache purge && sudo apt-get clean && rm -rf /tmp/*
-
85% success
pip install --target=/mnt/bigdisk/python-packages package_name
-
80% success
export TMPDIR=/mnt/bigdisk/tmp && pip install package_name
Dead Ends
Common approaches that don't work:
-
70% fail
Disabling cache does not free existing filesystem space and may still require temporary space for wheel building.
-
90% fail
Timeout is unrelated to disk space; the error persists.
-
80% fail
Elevated privileges do not create disk space and may write to a different partition but still fail.