# How to fix Python version incompatibility errors in uv

## Understanding the Error

When you see an error like this:

```
error: The Python request from `.python-version` resolved to Python 3.9.1, which is incompatible with the project's Python requirement: `>=3.10`. Use `uv python pin` to update the `.python-version` file to a compatible version.
```

This means:

1. Your project requires Python 3.10 or newer (specified in [pyproject.toml](https://pydevtools.com/handbook/reference/pyproject.toml.md))
2. Your `.python-version` file is requesting Python 3.9.1
3. This version conflict prevents [uv](https://pydevtools.com/handbook/reference/uv.md) from proceeding

## Solution Options

### Option 1: Update the `.python-version` File

The simplest approach is to follow uv's suggestion to update the `.python-version` file, e.g.,

```console
$ uv python pin 3.11
```

This will update the `.python-version` file to use Python 3.10, the minimum version compatible with your project.


### Option 2: Override the Python Version for a Single Command

If you don't want to update the pinned version permanently, you can override it for a single command:

```console
$ uv run --python 3.10 your_command
```

### Option 3: Update Your Project's Requirements

If you need to maintain Python 3.9.1 compatibility, you can modify your project's requirements in `pyproject.toml`:

```toml
[project]
# Change this line
requires-python = ">=3.9.1"
```

{{< callout type="info" >}}
To see which Python versions are available on your system:

```console
$ uv python list
```

If the version you need isn't installed, uv can install it automatically:

```console
$ uv python install 3.10
{{< /callout >}}

## Learn more

- [uv: A Complete Guide](https://pydevtools.com/handbook/explanation/uv-complete-guide.md) covers what uv does, how fast it is, the core workflows, and recent releases.
