Skip to content

uv's cache, its Python installs, and the commands that clean both

uv keeps packages in ~/.cache/uv and whole Python versions in ~/.local/share/uv. Where each lives, what uv cache prune removes, and what it leaves.

5 min read

uv replaces pip, virtualenv and pyenv in one tool, so its disk use comes in three parts: a package cache, managed Python versions, and installed tools. Each lives in a different folder.

Where uv keeps things

PathWhatCleaned by
~/.cache/uvPackage cacheuv cache clean or uv cache prune
~/.local/share/uv/pythonManaged Python versionsuv python uninstall
~/.local/share/uv/toolsTools from uv tool installuv tool uninstall
.venv in each projectThe project environmentDelete; uv sync rebuilds it
uv cache dir
du -sh "$(uv cache dir)" ~/.local/share/uv/* 2>/dev/null
uv python list --only-installed

prune or clean

  • uv cache prune removes entries nothing refers to any more, such as old versions and interrupted downloads. Safe to run any time.
  • uv cache clean empties the cache completely. The next install downloads everything again.
  • Neither touches installed Pythons or tools.

Like Bun, uv links packages from its cache into each .venv using APFS clones on a Mac, so environments cost less on disk than their folder sizes suggest. APFS clones and copies explains why.

Old Python versions

uv python list --only-installed
uv python uninstall 3.11

The rest of Python's footprint, pip's cache and Homebrew Pythons, is in Python taking up space, and environments from conda in conda environments.

Common questions

Where is the uv cache on a Mac?

In ~/.cache/uv by default. Run uv cache dir to print the path in use.

What is the difference between uv cache prune and uv cache clean?

prune removes only entries nothing uses any more. clean empties the cache entirely.

Where does uv install Python versions?

In ~/.local/share/uv/python. List them with uv python list --only-installed and remove one with uv python uninstall.

Does clearing the uv cache break my virtual environments?

No. Environments keep working. They are rebuilt from the cache or the network only when you sync again.

Read next