Language toolchains & SDKs

Reclaiming Disk From Python Virtualenvs and venv Folders on a 256GB Mac

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:

  • numpy compiled with BLAS/LAPACK can exceed 50 MB per environment.
  • torch (CPU-only) sits around 700 MB; a CUDA build goes over 2 GB.
  • tensorflow-macos and tensorflow-metal together 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

  1. Confirm the environment is not active: your shell prompt should not show the environment name in parentheses.
  2. Remove the folder with: rm -rf /path/to/your/venv
  3. If the environment was tracked in a .python-version or .tool-versions file, those files do not need to be deleted — they just reference version numbers, not the environment itself.

virtualenvwrapper

  1. Use the wrapper's own command so its bookkeeping stays clean: rmvirtualenv project-name
  2. Alternatively, delete the folder manually: rm -rf ~/.virtualenvs/project-name

pyenv-virtualenv

  1. Run: pyenv virtualenv-delete 3.11.9/envs/myenv
  2. Or remove the directory directly: rm -rf ~/.pyenv/versions/3.11.9/envs/myenv

conda / miniconda

  1. Deactivate the current environment: conda deactivate
  2. Remove the named environment: conda env remove --name myenv
  3. Conda also accumulates a package cache at ~/miniconda3/pkgs/ (or ~/opt/anaconda3/pkgs/). Clean it with: conda clean --all

Poetry

  1. From inside the project directory: poetry env remove python
  2. To remove all environments for a project: poetry env remove --all
  3. Poetry's cache folder at ~/Library/Caches/pypoetry/ can also hold wheel caches. Clear it with: poetry cache clear --all pypi

pipenv

  1. From inside the project directory: pipenv --rm
  2. 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.txt or pyproject.toml files — 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.cfg sweep 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-run first 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.

Reclaim your disk in one click

Crumb audits your whole Mac, tells you what's safe to delete, and frees the space in seconds — private, local, and Apple-notarized.

Download Crumb for macOS

Frequently asked questions

Is it safe to delete a Python virtualenv folder on Mac?
Yes. A virtualenv contains only installed packages and a Python interpreter copy — no source code, no project data. As long as your project has a requirements.txt, pyproject.toml, or Pipfile, you can recreate the environment at any time. Delete with confidence.
Where are Python virtualenvs stored on a Mac?
It depends on the tool. Standard venv and virtualenv create folders wherever you ran the command, often inside the project directory as venv/ or .venv/. Virtualenvwrapper stores them in ~/.virtualenvs/, pyenv-virtualenv uses ~/.pyenv/versions/<version>/envs/, Poetry uses ~/Library/Caches/pypoetry/virtualenvs/, and conda uses ~/miniconda3/envs/ or ~/opt/anaconda3/envs/ by default.
Will deleting a virtualenv remove my Python code or project files?
No. The virtualenv folder holds only packages and the interpreter — your source code lives alongside it or in a completely separate directory. Removing the venv/ or .venv/ folder inside a project does not touch your .py files, notebooks, or configuration.
How much space can I expect to reclaim?
It varies widely. A simple web project's virtualenv might be 80–150 MB, while a data science environment with PyTorch or TensorFlow can exceed 2 GB. Developers who have been working on a Mac for a year or more often find 10–40 GB tied up across virtualenvs, pip caches, and conda package archives combined.
Does deleting a virtualenv also remove cached pip packages?
No. The pip wheel cache lives separately at ~/Library/Caches/pip/ and is not removed when you delete a virtualenv. Run pip cache purge in Terminal to clear it independently. This cache is safe to delete — pip will simply re-download packages the next time they are needed.