A .venv or venv folder is one Python project's private environment, with its own installed packages. Look first. It is safe to delete if the project lists its dependencies in requirements.txt or a lockfile, because you can recreate it. If you installed packages by hand, note them before deleting.
- Path
.venv or venv folders inside Python projects- What it is
- A project's isolated Python environment created with python -m venv
- Typical size
- Tens to hundreds of megabytes; gigabytes with machine-learning packages
- Made by
- Python (venv, virtualenv) with pip, often via uv or an editor
- Safe to delete?
- Look first
- Comes back?
- Yes if the project has a requirements.txt or lockfile; otherwise you must recall what you installed
What is in this folder?
Python's venv module creates the folder and puts a pyvenv.cfg file inside, which is how tools recognize it. It contains links to the Python interpreter and a lib/site-packages folder with everything you pip installed.
Like node_modules, each project keeps its own copy, so a Mac with many projects accumulates many of them, especially when project folders are copied.
Is it safe to delete?
Usually. A virtual environment is meant to be disposable. If the project has a requirements.txt, pyproject.toml or lockfile, you can rebuild it in a minute or two. It is Look first rather than Safe to clear because packages installed ad hoc may not be recorded, and some environments pin an older Python that is hard to get back.
Run pip freeze inside the environment first if you are not sure.
How do I clear it by hand?
- Stop anything running from the environment, and deactivate it.
- Optionally save the package list.
- Delete the folder, and recreate it when you return to the project.
deactivate
.venv/bin/pip freeze > requirements.txt
rm -rf .venv
python3 -m venv .venv
.venv/bin/pip install -r requirements.txtRun the first two commands from the project folder. The last two rebuild the environment, so skip them if you are done with the project.
How do I stop it growing?
Delete the environments of finished projects, and share one environment across small scripts.
How Clean House handles it
Clean House identifies a folder as a Python virtual environment only when it has a pyvenv.cfg, so ordinary folders named venv are not touched. An environment inside a project is shown with that project, and a standalone one gets its own row, named after the folder that holds it. Files go to the Trash.