Skip to content
Latchkey

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.

pip output
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.

Terminal
df -h
pip cache purge
pip install --no-cache-dir -r requirements.txt

Point TMPDIR and the cache at a larger volume

Move pip’s scratch and cache to a roomier mount when the default device is small.

Terminal
export TMPDIR=/mnt/scratch/tmp
export PIP_CACHE_DIR=/mnt/scratch/pip-cache
mkdir -p "$TMPDIR" "$PIP_CACHE_DIR"
pip install -r requirements.txt

How to prevent it

  • Use a runner with enough disk for your largest wheel set.
  • Use --no-cache-dir for one-off jobs that pull huge wheels.
  • Prune unused Docker layers/artifacts earlier in the job to reclaim space.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →