> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/astral-sh/uv/llms.txt
> Use this file to discover all available pages before exploring further.

# uv python uninstall

> Uninstall Python versions

## Synopsis

```bash theme={null}
uv python uninstall [OPTIONS] <TARGETS>...
uv python uninstall [OPTIONS] --all
```

## Description

Uninstall Python versions.

Removes Python installations that were installed by uv. System Python installations cannot be uninstalled.

Either specific Python versions must be provided, or use `--all` to uninstall all managed Python versions.

## Arguments

### `<TARGETS>...`

The Python version(s) to uninstall.

See `uv help python` to view supported request formats.

**Required** unless `--all` is specified.

**Examples:**

* `3.12` - Uninstall all Python 3.12.x versions
* `3.12.4` - Uninstall Python 3.12.4 specifically
* `cpython@3.11` - Uninstall CPython 3.11.x
* `pypy@3.10` - Uninstall PyPy 3.10

## Options

### Installation Directory

#### `-d, --install-dir <INSTALL_DIR>`

The directory where the Python was installed.

* **Type:** Path
* **Default:** `~/.local/share/uv/python`
* **Environment variable:** `UV_PYTHON_INSTALL_DIR`

### Uninstall All

#### `--all`

Uninstall all managed Python versions.

* **Conflicts with:** `<TARGETS>`

**Warning:** This will remove all Python versions installed by uv.

## Version Request Formats

The following Python version request formats are supported:

* `<version>` e.g. `3`, `3.12`, `3.12.3`
* `<version-specifier>` e.g. `>=3.12,<3.13`
* `<version><short-variant>` e.g., `3.13t`, `3.12.0d`
* `<version>+<variant>` e.g., `3.13+freethreaded`, `3.12.0+debug`
* `<implementation>` e.g. `cpython` or `cp`
* `<implementation>@<version>` e.g. `cpython@3.12`
* `<implementation><version>` e.g. `cpython3.12` or `cp312`
* `<implementation><version-specifier>` e.g. `cpython>=3.12,<3.13`
* `<implementation>-<version>-<os>-<arch>-<libc>` e.g. `cpython-3.12.3-macos-aarch64-none`

## Output Format

### Successful Uninstall

```bash theme={null}
uv python uninstall 3.12
```

```
Uninstalled Python 3.12.8
 - cpython-3.12.8-macos-aarch64-none
```

### Multiple Versions

```bash theme={null}
uv python uninstall 3.11 3.12
```

```
Uninstalled 2 versions
 - cpython-3.11.11-macos-aarch64-none
 - cpython-3.12.8-macos-aarch64-none
```

### Version Not Found

```bash theme={null}
uv python uninstall 3.15
```

```
error: Python 3.15 is not installed

Installed Python versions:
  cpython-3.13.1-macos-aarch64-none
  cpython-3.12.8-macos-aarch64-none
  cpython-3.11.11-macos-aarch64-none
  cpython-3.10.16-macos-aarch64-none
```

### Uninstall All

```bash theme={null}
uv python uninstall --all
```

```
Uninstalled 4 versions
 - cpython-3.13.1-macos-aarch64-none
 - cpython-3.12.8-macos-aarch64-none
 - cpython-3.11.11-macos-aarch64-none
 - cpython-3.10.16-macos-aarch64-none
```

### No Managed Pythons

```bash theme={null}
uv python uninstall --all
```

```
No managed Python versions found
```

## Examples

### Uninstall a specific version

```bash theme={null}
uv python uninstall 3.12
```

Removes all Python 3.12.x installations.

### Uninstall a specific patch version

```bash theme={null}
uv python uninstall 3.12.4
```

Removes only Python 3.12.4.

### Uninstall multiple versions

```bash theme={null}
uv python uninstall 3.10 3.11
```

Removes Python 3.10.x and 3.11.x.

### Uninstall PyPy

```bash theme={null}
uv python uninstall pypy@3.10
```

### Uninstall all managed Python versions

```bash theme={null}
uv python uninstall --all
```

**Warning:** This removes all Python versions installed by uv.

### Uninstall from custom directory

```bash theme={null}
uv python uninstall 3.12 --install-dir /custom/python/dir
```

### Uninstall specific full key

```bash theme={null}
uv python uninstall cpython-3.12.8-macos-aarch64-none
```

### Check before uninstalling

```bash theme={null}
# List installed versions first
uv python list --only-installed

# Then uninstall
uv python uninstall 3.11
```

## Use Cases

### Free up disk space

```bash theme={null}
# Check what's installed
uv python list --only-installed

# Remove old versions
uv python uninstall 3.9 3.10
```

### Clean installation

```bash theme={null}
# Remove all uv-managed Python
uv python uninstall --all

# Reinstall fresh
uv python install 3.12 3.13
```

### Remove after upgrading

```bash theme={null}
# Upgrade to latest patch
uv python install 3.12 --upgrade

# Old 3.12.7 is still there, remove it
uv python uninstall 3.12.7
```

### Test environment cleanup

```bash theme={null}
# After testing with multiple versions
uv python uninstall pypy@3.10 3.13t
```

### Migration cleanup

```bash theme={null}
# Migrated from 3.11 to 3.12
# Remove old version
uv python uninstall 3.11
```

### Script cleanup

```bash theme={null}
#!/bin/bash
# Clean up test Python installations

echo "Installed Python versions:"
uv python list --only-installed

read -p "Remove all managed Python versions? (y/n) " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
  uv python uninstall --all
  echo "All managed Python versions removed"
fi
```

### Selective cleanup

```bash theme={null}
# Keep 3.12 and 3.13, remove everything else
uv python list --only-installed | grep -v "3.12\|3.13" | while read -r version; do
  uv python uninstall "$version"
done
```

### Verify and uninstall

```bash theme={null}
# Check if specific version is installed
if uv python find 3.10 > /dev/null 2>&1; then
  echo "Uninstalling Python 3.10"
  uv python uninstall 3.10
else
  echo "Python 3.10 not installed"
fi
```

### Reinstall

```bash theme={null}
# Uninstall and reinstall to fix issues
uv python uninstall 3.12
uv python install 3.12
```

## Important Notes

### Virtual Environments

**Warning:** Uninstalling a Python version will break any virtual environments that use it.

```bash theme={null}
# Check what's using a Python version
find . -name "pyvenv.cfg" -exec grep -l "3.11" {} \;

# Recreate environments after uninstalling
uv sync  # In each project
```

### System Python

uv cannot uninstall system Python installations. Only Python versions installed by uv can be removed.

```bash theme={null}
# This won't work if Python 3.11 is a system installation
uv python uninstall 3.11

# Error: Cannot uninstall system Python
```

### Executables

Uninstalling a Python version also removes associated executables installed in the bin directory.

### No Confirmation

The uninstall command does not ask for confirmation. Use carefully, especially with `--all`.

```bash theme={null}
# No "Are you sure?" prompt
uv python uninstall --all  # Immediately removes everything
```

## Verification

### After uninstalling

```bash theme={null}
# Verify removal
uv python list --only-installed

# Check specific version is gone
uv python find 3.11  # Should fail if 3.11 was uninstalled
```

### Check disk space freed

```bash theme={null}
# Before
du -sh ~/.local/share/uv/python

# Uninstall
uv python uninstall 3.10 3.11

# After
du -sh ~/.local/share/uv/python
```

## Troubleshooting

### Cannot uninstall system Python

```
error: Cannot uninstall system Python installation
```

uv only uninstalls Python versions that it installed. System Python (from your OS package manager, Homebrew, etc.) cannot be removed by uv.

### Version not found

```
error: Python 3.12 is not installed
```

The requested Python version is not installed, or it's a system installation that uv doesn't manage.

Check installed versions:

```bash theme={null}
uv python list --only-installed
```

### Virtual environment errors after uninstall

If you see errors in virtual environments after uninstalling Python:

```bash theme={null}
# Recreate the virtual environment
rm -rf .venv
uv sync
```

## See Also

* [`uv python install`](python-install.mdx) - Download and install Python versions
* [`uv python list`](python-list.mdx) - List available Python installations
* [`uv python find`](python-find.mdx) - Find a Python installation
* [`uv python pin`](python-pin.mdx) - Pin to a specific Python version
