Python disk space on a Mac: pip cache, uv cache and .venv folders

Where pip and uv keep their caches on a Mac, what pip cache purge and uv cache clean really free, why a uv .venv looks bigger than it is, and extra Pythons.

Short answer

pip keeps its cache in ~/Library/Caches/pip, uv in ~/.cache/uv. pip cache purge and uv cache clean are both safe: installed packages keep working. The bigger space is usually elsewhere: .venv folders in your projects (rebuild them with uv sync), tools you installed with uv tool install, and several copies of Python itself from Homebrew, python.org and uv. On macOS, a uv .venv shares disk blocks with uv's cache, so du overstates what deleting either one frees.

Where Python's space goes

I checked my own Mac on 3 November 2026 (macOS 26.5.1, pip 26.1.2, uv 0.11.17):

WhatWhereSize
5 project .venv foldersinside each project2.4 GB
Python from python.org (3.12)/Library/Frameworks/Python.framework476 MB
uv tools (5 installed)~/.local/share/uv/tools661 MB
Pythons uv installed (3.11, 3.13, 3.14)~/.local/share/uv/python208 MB
uv cache~/.cache/uv198 MB
Homebrew's Python 3.14/opt/homebrew/Cellar/python@3.1488 MB
pip cache~/Library/Caches/pip0 bytes

The caches everyone tells you to clear were the smallest part. One .venv alone was 1.4 GB, 590 MB of it PyTorch. And this Mac had Python 3.14 twice, from Homebrew and from uv, plus a 3.12 from python.org I'd forgotten about.

Check your Mac

These only read:

Terminal
$ pip3 cache info
$ uv cache dir && du -sh "$(uv cache dir)"
$ uv python list --only-installed
$ du -sh ~/.local/share/uv/tools/* 2>/dev/null | sort -h
$ find ~ -maxdepth 4 -type d \( -name .venv -o -name venv \) -prune -exec du -sh {} + 2>/dev/null | sort -h

The last line finds virtual environments up to four folders deep in your home folder. Raise -maxdepth if your projects sit deeper.

The pip cache

pip keeps two caches in ~/Library/Caches/pip: an HTTP cache of what it downloaded from PyPI (http-v2) and wheels it built from source (wheels). pip cache info shows the size of each.

Terminal
$ pip3 cache list            # wheels pip built
$ pip3 cache remove numpy    # one package
$ pip3 cache purge           # everything

pip cache purge clears both caches. Packages you've installed keep working; pip downloads or builds them again only when you next install them. The cost is a slower next install, most noticeable for packages that build from source.

If you have several Pythons, each has its own pip, but they share the same cache folder.

The uv cache

uv keeps downloaded wheels, unpacked packages and its index cache in ~/.cache/uv:

Terminal
$ uv cache clean           # remove everything
$ uv cache clean numpy     # one package
$ uv cache prune           # only entries nothing uses anymore

uv cache prune removes entries left by older uv versions and other unused files, and uv's docs say it's safe to run regularly. uv cache clean empties the cache; uv downloads packages again when it next needs them.

Why it frees less than it looks. On macOS, uv's default link mode is clone: it installs a package into a .venv as an APFS copy-on-write clone of the file in its cache. The clone and the original share the same blocks on disk until one of them changes. du counts those blocks under the cache and again under every .venv, so the totals overlap. Delete the cache and the blocks still in use by a .venv stay where they are. For a closer number, uv has a preview flag that accounts for clones:

Terminal
$ uv cache clean --preview-features cache-physical-space

The same goes the other way: deleting a uv .venv frees less than du says if the cache still holds the same files. pnpm's store behaves the same way for node_modules.

.venv folders

A virtual environment is a full copy of every package a project uses, so a machine learning project can take gigabytes. It's also the easiest Python space to get back, because it's rebuildable from the project's own files:

Terminal
# uv project: rebuilds .venv from uv.lock
$ uv sync

# pip project: in a fresh venv
$ python3 -m venv .venv && .venv/bin/pip install -r requirements.txt

Move a .venv to the Trash rather than deleting it outright, so you can put it back if a rebuild fails:

Terminal
$ mv ~/Projects/old-app/.venv ~/.Trash/old-app-venv
Check first

Before you remove a .venv, make sure everything in it is written down. pip freeze > requirements.txt captures what's installed. A package you added with pip install and never put in requirements.txt or pyproject.toml won't come back on its own.

You can tell whether uv made a .venv from its pyvenv.cfg: uv adds a uv = … line with its version. On my Mac, two of the five were made by uv, three by python3 -m venv.

uv tools and extra Pythons

uv tools. Every uv tool install gets its own environment in ~/.local/share/uv/tools. Mine held 661 MB, half of it one tool I'd tried once (312 MB). uv tool list shows them, uv tool uninstall <name> removes one.

Pythons. uv python list --only-installed lists every Python uv can find, wherever it came from, with its path. That's the quickest way to spot duplicates. Remove each with the tool that installed it:

Terminal
$ uv python uninstall 3.11   # a Python uv installed
$ brew uninstall python@3.12 # a Python Homebrew installed

A Python from python.org lives in /Library/Frameworks/Python.framework/Versions/<version>, with links in /usr/local/bin and an app folder in /Applications. python.org has no uninstaller, so check nothing on your Mac still uses it before you remove those three by hand. Never touch /usr/bin/python3: that's Apple's, and it's part of the system.

Shedi finds .venv folders in every project and clears pip's cacheIt lists each project's .venv with what rebuilds it, shows pip's and uv's caches, runs conda clean for Conda, and moves what you pick to the Trash. uv venvs are listed without a size, because of the clones above.
Get Shedi

What not to delete

  • /usr/bin/python3 and anything under /System: they belong to macOS.
  • A .venv whose packages aren't written down in the project.
  • ~/.local/share/uv/python/<version> while a .venv still uses it: a venv points at the Python it was made from (the home = line in pyvenv.cfg) and stops working without it.

Sources

  • Caching, pip docs: cache locations on macOS and pip cache purge
  • Caching, uv docs: uv cache clean, uv cache prune, and the cache-physical-space preview
  • Settings: link-mode, uv docs: clone (copy-on-write) is the default on macOS
  • pip3 cache --help, uv cache prune --help and uv python uninstall --help, run on macOS 26.5.1 on 3 November 2026

Questions

Where is the pip cache on a Mac?

In ~/Library/Caches/pip. pip cache dir prints it, and pip cache info shows how big the wheel and HTTP caches are. Since pip 26.2, pip also respects XDG_CACHE_HOME on macOS, so it can be elsewhere if you set that.

Is it safe to run pip cache purge?

Yes. It removes every file from pip's wheel and HTTP caches. Installed packages keep working; pip only downloads or builds them again the next time you install them.

Where is the uv cache on a Mac?

In ~/.cache/uv, or $XDG_CACHE_HOME/uv if that's set. uv cache dir prints it.

Why does uv cache clean free less than the cache's size?

On macOS, uv installs packages into virtual environments as APFS clones of the files in its cache. A clone shares disk blocks with the original, so as long as a .venv still holds a clone, deleting the cache copy frees almost nothing for that file. du counts the shared blocks in both places.

Can I delete a .venv folder?

Yes, if the project lists its packages: uv sync, or pip install -r requirements.txt in a new venv, rebuilds it. Packages you installed by hand without adding them to pyproject.toml or requirements.txt won't come back.

How do I remove a Python version uv installed?

uv python list --only-installed shows every Python uv can see and where it lives. uv python uninstall 3.11 removes a version that uv installed. It doesn't remove Homebrew's or python.org's Pythons; those need brew uninstall or the python.org uninstall steps.