If you have spent any time doing Python development on a Mac, you have almost certainly accumulated a sprawl of virtual environments scattered across your home folder. Knowing how to delete python virtualenv mac folders safely — without accidentally breaking active projects — is one of the most effective ways to reclaim space on a 256 GB machine. A single virtualenv can hold anywhere from 30 MB to several hundred megabytes once you add data science libraries like NumPy, Pandas, or PyTorch, and most developers have dozens of them sitting around from projects they finished months or years ago.
Why Virtualenvs Balloon So Fast on Disk
Python's isolation model is one of its strengths: each project gets its own interpreter copy and dependency tree. The trade-off is that common packages are not shared. If ten projects each install requests, boto3, and Pillow, those wheels are duplicated ten times on disk. The situation gets worse with scientific Python:
numpycompiled with BLAS/LAPACK can exceed 50 MB per environment.torch(CPU-only) sits around 700 MB; a CUDA build goes over 2 GB.tensorflow-macosandtensorflow-metaltogether can surpass 1.5 GB.- Jupyter and its kernel stack adds another 200–400 MB per environment.
Multiply this by the typical lifetime output of even a casual developer — tutorials, hackathons, client sprints, side experiments — and it is easy to have 10–30 GB locked up in environments that have not been activated in over a year.
Where Python Environments Live on macOS
The tricky part is that virtualenvs have no single canonical location. They appear wherever the developer happened to create them. The most common spots are:
| Tool | Default environment path on macOS | Typical size |
|---|---|---|
python -m venv |
Inside the project folder, usually ./venv or ./.venv |
80–500 MB |
virtualenv |
Inside the project folder or ~/.virtualenvs/ |
80–600 MB |
virtualenvwrapper |
~/.virtualenvs/<name>/ |
80–600 MB |
pyenv-virtualenv |
~/.pyenv/versions/<version>/envs/<name>/ |
100–800 MB |
conda / miniconda |
~/miniconda3/envs/<name>/ or ~/opt/anaconda3/envs/<name>/ |
200 MB – 4 GB |
poetry |
~/Library/Caches/pypoetry/virtualenvs/ |
100–700 MB |
pipenv |
~/.local/share/virtualenvs/<hash>/ |
100–600 MB |
hatch |
~/Library/Application Support/hatch/env/virtual/ |
80–500 MB |
Note that Poetry stores its environments inside ~/Library/Caches/, which means they can also show up inflating the Caches section of macOS's storage report — another reason the system data number on a Mac can seem deceptively large.
Finding All Stale Virtualenvs Across Your Mac
Before deleting anything, run a discovery pass. The reliable fingerprint of any virtualenv is a file called pyvenv.cfg sitting at the environment root. You can use find to locate every one of them:
find ~ -name pyvenv.cfg -not -path "*/.Trash/*" 2>/dev/null
That lists every virtualenv under your home directory. To also see approximate sizes alongside each path, pipe through du:
find ~ -name pyvenv.cfg -not -path "*/.Trash/*" 2>/dev/null \
| xargs -I{} dirname {} \
| xargs du -sh 2>/dev/null \
| sort -rh
For conda environments, list them directly:
conda env list
For pipenv environments:
pipenv --venv 2>/dev/null || echo "not in a pipenv project"
Run these commands in Terminal on both Apple Silicon Macs (running macOS Sequoia or Tahoe) and Intel Macs — the commands are identical regardless of architecture.
How to Delete Python Virtualenvs on Mac: Step-by-Step
The process varies slightly by tool, but the core rule is always the same: deactivate first, then remove.
Standard venv and virtualenv
- Confirm the environment is not active: your shell prompt should not show the environment name in parentheses.
- Remove the folder with:
rm -rf /path/to/your/venv - If the environment was tracked in a
.python-versionor.tool-versionsfile, those files do not need to be deleted — they just reference version numbers, not the environment itself.
virtualenvwrapper
- Use the wrapper's own command so its bookkeeping stays clean:
rmvirtualenv project-name - Alternatively, delete the folder manually:
rm -rf ~/.virtualenvs/project-name
pyenv-virtualenv
- Run:
pyenv virtualenv-delete 3.11.9/envs/myenv - Or remove the directory directly:
rm -rf ~/.pyenv/versions/3.11.9/envs/myenv
conda / miniconda
- Deactivate the current environment:
conda deactivate - Remove the named environment:
conda env remove --name myenv - Conda also accumulates a package cache at
~/miniconda3/pkgs/(or~/opt/anaconda3/pkgs/). Clean it with:conda clean --all
Poetry
- From inside the project directory:
poetry env remove python - To remove all environments for a project:
poetry env remove --all - Poetry's cache folder at
~/Library/Caches/pypoetry/can also hold wheel caches. Clear it with:poetry cache clear --all pypi
pipenv
- From inside the project directory:
pipenv --rm - This removes the environment stored under
~/.local/share/virtualenvs/.
What You Can Safely Delete vs. What to Keep
A virtualenv contains only installed packages and a copy (or symlink) of the Python interpreter. It holds no source code, no project data, and no configuration that cannot be regenerated. If the project has a requirements.txt, pyproject.toml, or Pipfile, you can always recreate the environment from scratch with pip install -r requirements.txt or the equivalent tool command. This makes virtualenvs one of the safest categories of disk usage to purge aggressively.
What you should not delete alongside them:
- Your project's source files — those live outside the
venv/folder. - The
requirements.txtorpyproject.tomlfiles — these let you rebuild. - Your system Python or pyenv-managed Python versions themselves (the interpreter binaries under
~/.pyenv/versions/3.x.x/bin/), unless you also intend to remove that Python version entirely.
If you also do heavy Node.js work, the same principle applies to node_modules/; the approach for that is covered in detail in cleaning up node_modules on Mac.
Dealing with pip and Wheel Caches
Even after removing all virtualenvs, pip keeps a cache of downloaded wheel files so it does not have to re-download packages the next time you install them. On macOS this cache lives at:
~/Library/Caches/pip/
Check its size:
du -sh ~/Library/Caches/pip/
Clear it safely (pip will simply re-download packages as needed in the future):
pip cache purge
For uv, the increasingly popular Rust-based package manager, the cache is at ~/.cache/uv/ on macOS and can be cleared with uv cache clean. If you have switched to uv but ran traditional pip installs in the past, you may have both caches consuming space.
Automating the Cleanup for Future Projects
A few habits that prevent the buildup from returning:
- Always create the virtualenv inside the project directory (as
.venv/) and add.venv/to.gitignore. When you delete the project folder, the environment goes with it. - Set a calendar reminder every quarter to run the
find ~ -name pyvenv.cfgsweep and audit what is still relevant. - If you use VS Code or Cursor, they tend to remember environment paths even after the folder is gone — clearing stale interpreter entries from the workspace settings avoids confusing errors.
- For conda-heavy workflows, run
conda clean --all --dry-runfirst to preview what will be removed before committing.
On a heavily used 256 GB Mac it is not unusual for developers to discover 15–40 GB locked up across virtualenvs, pip caches, and conda package archives. A tool like Crumb can audit all of these locations at once and show what is safe before you delete, which is useful when you want to review everything visually rather than run a series of terminal commands. Either way, the underlying cleanup is straightforward once you know where to look.
Checking Your Results in Finder and System Settings
After running your cleanup commands, give macOS a moment to update its storage index. Then open System Settings → General → Storage (on macOS Sequoia and Tahoe) and look at the Developer category. This category aggregates Xcode build artifacts, simulator runtimes, and language toolchain data — you should see it shrink after removing large conda or poetry caches. The Documents and Other categories may also decrease if your virtualenvs were scattered inside project folders tracked there. If the numbers feel stale, a reboot clears the storage cache and forces a fresh tally.