How to delete a venv or virtualenv on Mac
It’s safe to delete a venv on a Mac: Python’s documentation calls a virtual environment disposable, simple to delete and create again, and your code is not inside it. With machine learning libraries one environment easily takes a few gigabytes. This guide shows what to save first so you can create it again, how to delete it and how to bring it back.

- Open MacWashing and choose System Junk in the sidebar.
- Click Start Scan.
- Look through what it found and click Clean. Anything debatable stays unchecked.
Free trial · macOS 14 or later
What is inside a venv
A virtual environment is a folder with a link to Python and every package you installed into it. With machine learning libraries one environment easily takes a few gigabytes. Your code is not in it, so deleting it loses nothing you can’t install again.
Save the list of packages first
If the project has a requirements.txt, a pyproject.toml or a lock file such as uv.lock or poetry.lock, the environment can be made again from it. If it has none, activate the environment in the project folder:
source .venv/bin/activateThen save the list of installed packages and their versions to requirements.txt:
python3 -m pip freeze > requirements.txtHow to delete a venv
- If the environment is active in Terminal, type
deactivateand press Return. Quit your code editor if it uses this environment. - In Finder, open the project folder.
.venvis hidden: press Shift-Command-. (period) to show hidden files.

- Move the
.venvorvenvfolder to the Trash, then empty the Trash.
Or in Terminal, in the project folder. This command deletes the .venv folder with every package in it, for good. Your code and the requirements file stay:
rm -rf .venvEnvironments kept outside projects usually live in ~/.virtualenvs, a folder each: delete the folder of the one you no longer need. Conda environments are not venvs: remove them with conda’s own commands.
How to create the venv again
In the project folder, create a new environment:
python3 -m venv .venvActivate it and install the packages from the requirements file:
source .venv/bin/activate
python3 -m pip install -r requirements.txtFor a project described by pyproject.toml, run this instead:
python3 -m pip install --editable .In a uv project, this command creates .venv itself and installs everything from uv.lock:
uv syncpip takes packages from its cache when it can, so this is faster than the first install. If you also cleared the pip cache, everything is downloaded again.
With MacWashing, it’s one click

System Junk in MacWashing lists the .venv and venv folders of Python projects you haven’t changed for 90 days under Project Dependencies, unchecked: installing the packages again takes internet and time, so you decide. The caches of your apps and developer tools are cleared in the same pass.
Free trial · macOS 14 or later
Questions and answers
Will MacWashing delete my own files when it cleans?
No. It removes only what it can match to a known app or a known kind of junk, in places apps leave files; macOS and Apple’s files are never touched. Anything debatable is marked and stays unchecked until you decide.
What about apps that are open?
If an open app holds files being cleaned, MacWashing waits for it to quit or quits it at your request, and opens it again afterwards.
Is it free?
Yes, within the free trial: System Junk and the Uninstaller free up to 25 GB in total, with no account or card needed.
Is it safe to delete a venv?
Yes, as long as you can install the packages again: keep the project’s requirements file or lock file. Your code is not inside the environment.
Is there a command to delete a virtualenv?
No. Neither venv nor virtualenv has one: you delete the folder. deactivate only switches the environment off in the current Terminal window.
Can I move or rename a venv instead?
No. A venv remembers the path it was created at and stops working after a move. Python’s documentation says to create a new one in the new place and delete the old one.