astral-sh/uv

A way to remove old Python versions

Open

#15805 opened on Sep 12, 2025

View on GitHub
 (3 comments) (7 reactions) (0 assignees)Rust (84,934 stars) (3,111 forks)batch import
enhancementhelp wanted

Description

Summary

After using uv to install all active Python versions and keep them updated for a while, I found my ~/.local/share/uv/python directory consuming 3GB. This includes many versions I won't use again, like the alpha and beta versions of 3.14.

I couldn't find an easy way to remove all but the latest version of each Python (including freethreading variants), so I found it easier to blast them all away with uv python uninstall --all and then re-running my automated install process (using Ansible).

This clearout saved me ~2.3GB of disk space.

This is a bit unintuitive and wastes time and bandwidth. It would be nicer if there were a way to prune down the installed Python versions to just the latest of each release, or something like that.

Example

$ uv python uninstall --outdated
Searching for Python installations
Uninstalled 7 outdated Python versions in 14.45s:
 - cpython-3.9.20-macos-aarch64-none
 - cpython-3.9.21-macos-aarch64-none
 - cpython-3.9.22-macos-aarch64-none
...

Contributor guide