Is it safe to delete Python __pycache__?

<project>/__pycache__ · Safe to delete

What it is

Compiled Python bytecode (.pyc) for faster imports.

Can you delete it?

Yes, it is rebuilt automatically. Python writes it again the next time the code runs.

How to clean it safely

  1. Run: find . -name __pycache__ -type d -prune -exec rm -rf {} + (inside the project)

Step-by-step guide: Clean up Python environments →

Questions

Is it safe to delete <project>/__pycache__?

Yes, it is rebuilt automatically. Python writes it again the next time the code runs.

Let the raccoon do it, safely

Junk Raccoon finds this clutter for you, shows every file first, and keeps a one-click way back. Free to download, no account, no ads.

Download for Mac