astral-sh/uv

A way to remove old Python versions

Open

#15,805 建立於 2025年9月12日

在 GitHub 查看
 (3 留言) (7 反應) (0 負責人)Rust (3,111 fork)batch import
enhancementhelp wanted

倉庫指標

Star
 (84,934 star)
PR 合併指標
 (平均合併 11天 15小時) (30 天內合併 200 個 PR)

描述

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
...

貢獻者指南