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
- Run:
find . -name __pycache__ -type d -prune -exec rm -rf {} + (inside the project)
Step-by-step guide: Clean up Python environments →
Related folders
- Poetry cache ·
~/Library/Caches/pypoetry - pip cache ·
~/Library/Caches/pip - uv cache ·
~/.cache/uv - Conda package cache ·
~/miniconda3/pkgs - .tox / .nox ·
<project>/.tox - .mypy_cache / .pytest_cache ·
<project>/.mypy_cache
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