ProjectStack
python

OSError: [Errno 28] No space left on device

The disk your Python script is writing to is completely full. No more data can be written until you free up space.

Common causes

  • The disk partition is 100% full — no free space remains
  • A log file, database, or data output file grew and filled the disk
  • A large download, model weights, or dataset consumed all available disk space
  • Running in a Docker container or VM with a small disk quota

How to fix it

  1. Check disk usage: df -h (Mac/Linux) or dir (Windows)
  2. Find large files: du -sh * | sort -rh | head (Mac/Linux)
  3. Delete temp files, old logs, or cached data: pip cache purge
  4. Move data to a larger disk or expand the volume/partition

Example

Traceback (most recent call last): File "app.py", line 5, in <module> f.write(data) OSError: [Errno 28] No space left on device

Writing a large dataset to disk when the partition is completely full

Have a different error?

Paste any error message into the Error Translator to get an instant explanation.