astral-sh/uv

A way to remove old Python versions

開放

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

 (3 則留言) (11 個反應) (0 位負責人)Rust (3,111 個分叉)batch import
enhancementhelp wanted

倉庫指標

星標
 (84,934 顆星)
PR 合併指標
 (平均合併 7天 16小時) (30 天內合併 259 個 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
...

貢獻者指南