Python virtual environments on a Mac: finding orphan .venv folders and the pip, conda and uv caches

By the Zofle team · 13 November 2026 · 5 min read

Python virtual environments on a Mac: orphan .venv folders and caches

Every Python project that uses <code>python -m venv</code> gets its own copy of every package. You make one, forget it, and it stays. We scanned one developer Mac on 13 November 2026 to see how much that adds up to.

What we found: 32 environments, 3.1 GB

MeasureResult
Virtual environments found under the home folder32
Total size3.1 GB (3,183 MB)
Python 3.13 / 3.12 / 3.1026 envs, 2.8 GB / 5 envs, 0.28 GB / 1 env, 0.01 GB
Larger than 100 MB8 environments, 1.7 GB (55% of the total)
Biggest one785 MB (25% of the total, see below)
Not touched in the last 14 days (folder date)9 environments, 0.57 GB
Broken: its Python no longer exists1 (12 MB). It was made on Windows and copied over, so home pointed at C:\Python310
pip download cache (~/Library/Caches/pip)101 MB, 344 cached HTTP files, 0 locally built wheels
conda, uv, pyenvNot installed on this Mac, so no ~/.conda/pkgs to count

Why one environment is 785 MB

The average here is 100 MB, but one environment was eight times that. We looked inside its <code>site-packages</code>:

PackageSize
kubernetes81 MB
onnxruntime80 MB
pandas71 MB
chromadb (Rust bindings)50 MB
duckdb44 MB
grpc40 MB

Six packages are 366 MB. Nothing is wrong: a project that depends on a machine-learning runtime and a vector store is just big. The point is that you can't guess from the folder name, so measure.

Find them all (read-only)

<code>find</code> does the job without extra tools. Every environment has a <code>pyvenv.cfg</code> file, so look for that. Save this as <code>venvscan.sh</code> and pass the folders where you keep code:

bash
# List every virtualenv under the folders you pass, with size, last-modified and a flag
for root in "$@"; do
  find "$root" -name pyvenv.cfg -not -path "*/Library/*" -not -path "*/node_modules/*" -not -path "*/site-packages/*" 2>/dev/null
done | while read -r cfg; do
  d=$(dirname "$cfg")
  home=$(sed -n 's/^home *= *//p' "$cfg")
  kb=$(du -sk "$d" | cut -f1)
  flag=""
  [ -d "$home" ] || flag="BROKEN-PYTHON"
  case "$home" in */.venv/*|*/venv/*) flag="$flag BASED-ON-ANOTHER-VENV";; esac
  printf '%8s MB  %s  %s  %s\n' $((kb/1024)) "$(stat -f %Sm -t %Y-%m-%d "$d")" "$d" "$flag"
done | sort -rn

# usage: bash venvscan.sh ~/projects ~/code ~/Desktop

On our Mac it scanned about 30 folders' worth of projects in 22 seconds and printed the 32 lines behind the table above. If you have <code>fd</code>, <code>fd -H -t f pyvenv.cfg ~/projects</code> does the finding faster. The <code>du</code> still takes the time.

Which ones are really orphans?

A big old environment isn't automatically junk. Go through these in order:

  1. BROKEN-PYTHON in the last column: its Python is gone, so it can't run anyway. Delete it. (Ours was the Windows one.)
  2. The project folder is gone or archived: if the folder next to the venv has no source files, the venv is an orphan.
  3. Nothing in the project has changed for months: in the project folder run git log -1 --format=%cd. The venv's folder date only says when packages were installed, not when you last used it.
  4. Is there a requirements file? If requirements.txt, pyproject.toml or a lock file exists, you can rebuild the venv in a minute or two with python3 -m venv .venv && .venv/bin/pip install -r requirements.txt. If there isn't one, run .venv/bin/pip freeze > requirements.txt before you delete it.

Deleting a venv never touches your code. It's a folder of installed packages. Move it to the Trash for a day if you want a way back.

The package caches

bash
# pip
python3 -m pip cache dir
python3 -m pip cache info     # size + file counts
python3 -m pip cache purge    # empties it; pip downloads again when needed

# conda / Miniconda (if you use it)
conda clean --all --dry-run   # shows what would go
conda clean --all
conda env list                # every environment, with its path
conda env remove -n old-env

# uv (if you use it)
uv cache dir
uv cache prune                # drops unused entries
uv cache clean                # drops everything

On our Mac the pip cache was 101 MB: the smallest line in the table. If you use conda, <code>~/.conda/pkgs</code> and <code>~/miniconda3/pkgs</code> are the places to look, and the <code>--dry-run</code> run above tells you the number. We didn't have conda installed, so that part isn't a measurement from our Mac.

Per-project habit that stops this

  • Keep one .venv inside each project folder, so deleting the project deletes its environment.
  • Write requirements.txt (or a lock file) so any environment can be thrown away and rebuilt.
  • When you archive an old project, delete its .venv and node_modules first.

Related: Developer disk hogs: Gradle, npm, node_modules and the caches that never go away and Homebrew storage on a Mac.

Zofle, our free Mac app, finds big developer folders like old environments and shows what each one is before you remove anything.

Download Zofle for Mac

Sources

  • Python docs: venv, creation of virtual environments (the pyvenv.cfg file and its home key).
  • pip docs: pip cache.
  • conda docs: conda clean. uv docs: Caching.
  • Our own scan of one Mac on 13 November 2026 (find, du, pip cache info); the script above is the one we ran.
  • The conda and uv commands are from their documentation; those tools weren't installed on the Mac we measured.

Zofle Pro news

People signing up now will get Zofle Pro, with more features, for free when we launch it.

One email when it's ready. No spam, ever.