pip "OSError: [Errno 28] No space left on device" in CI
The runner ran out of disk while pip unpacked or cached packages. Large wheels (CUDA, scientific stacks) plus the pip cache and /tmp can exhaust a small runner volume.
What this error means
pip fails mid-install with [Errno 28] No space left on device, often while unpacking a big wheel or writing to /tmp. Freeing disk or pointing the cache elsewhere makes the same command succeed.
ERROR: Could not install packages due to an OSError: [Errno 28]
No space left on device
Errno 28] No space left on device: '/tmp/pip-unpack-abcd1234/torch-...whl'Common causes
Small runner disk and large wheels
GPU/scientific wheels are hundreds of MB each. Downloading, caching, and unpacking several at once overflows a constrained runner volume.
A full /tmp or pip cache
pip unpacks into /tmp and caches under ~/.cache/pip. If /tmp is a small tmpfs or the cache grew unbounded, the device fills.
How to fix it
Free space and avoid caching big artifacts
Reclaim disk and skip caching for one-shot large installs.
df -h
pip cache purge
pip install --no-cache-dir -r requirements.txtPoint TMPDIR and the cache at a larger volume
Move pip’s scratch and cache to a roomier mount when the default device is small.
export TMPDIR=/mnt/scratch/tmp
export PIP_CACHE_DIR=/mnt/scratch/pip-cache
mkdir -p "$TMPDIR" "$PIP_CACHE_DIR"
pip install -r requirements.txtHow to prevent it
- Use a runner with enough disk for your largest wheel set.
- Use
--no-cache-dirfor one-off jobs that pull huge wheels. - Prune unused Docker layers/artifacts earlier in the job to reclaim space.