# invalid Python version specified: failed to resolve version matching How to fix it.

URL: https://antideploy.com/blog/python-version-not-available

Your project asks for a Python version the builder does not have. The message lists the versions it does have. Pin one of those.

**What you see**

```
ERROR: invalid Python version specified: failed to resolve version
matching: 3.8 against [the versions the builder offers]
```

## At a glance

- **What it means**: The version is not offered
- **The fix**: Pin a version from the list
- **Where to pin**: .python-version is simplest
- **Safe for ML**: 3.12 works for common packages

Published 7 October 2026. Facts checked 7 October 2026. 1 min read.

## What it means

Your project asked for a Python version, and the builder has no such version. The message names the version you asked for and lists the versions the builder offers. Retrying without a change fails the same way.

## How to fix it

### 1. Pick a version from the list in the message

Choose one of the versions the message lists. For common packages such as `tensorflow`, `torch`, `numpy` and `pandas`, `3.12` is a safe choice.

### 2. Pin it in your project

Put the version in one of the files the build reads: a `.python-version` file, a `runtime.txt` file (for example `python-3.12.4`), or `requires-python` in `pyproject.toml`.

### 3. Commit and deploy again

A failed deploy never counts against your plan.

**.python-version**

```
3.12
```

## Where the version comes from

The build looks for a version in this order: `.python-version`, then `runtime.txt`, then `requires-python` in `pyproject.toml`. If you pin none, Antideploy asks the builder for a default of its own.

## When it is Antideploy's default

If the version in the message is not one you chose, the default Antideploy asked for is no longer offered. That is a fault on Antideploy's side. Pin one of the listed versions in `.python-version` and it builds again straight away, and please tell us so we can move our default.

## Python version questions, answered.

Anything else? Write to us and a person answers.

[support@antideploy.com](mailto:support@antideploy.com)

### Which Python version should I choose?

The newest one in the list that your packages support. If a package fails to install, try `3.12`.

### Can I use an old version like 3.8?

Only if the builder still offers it. The message shows exactly what is offered.

### Does this failed deploy cost anything?

No. Failed deploys never count against your plan.

## More guides, and the platform.

Each platform page covers one part of Antideploy: what it does, where it stops and the questions people ask. [See the whole platform](https://antideploy.com/platform), or [all the guides](https://antideploy.com/blog).

- [ERROR: Could not find a version that satisfies the requirement](https://antideploy.com/blog/could-not-find-a-version-that-satisfies-the-requirement): No version matches your requirements.txt, often because of the Python version. Pin Python or loosen the pin.
- [ERROR: Failed building wheel for psycopg2](https://antideploy.com/blog/failed-building-wheel): A package had to be compiled and the compile failed. Use a prebuilt version, or pin Python to 3.12.
- [How to deploy a FastAPI app with Postgres for free](https://antideploy.com/blog/how-to-deploy-a-fastapi-app-with-postgres-for-free): The uvicorn command, the port, DATABASE_URL, Alembic migrations and the Python version.

- [Deployments](https://antideploy.com/platform/deployments)
- [Logs and monitoring](https://antideploy.com/platform/logs-and-monitoring)
- [Hosting](https://antideploy.com/platform/hosting)

Facts on this page were checked against the live platform on 7 October 2026.

## Deploy something. Start with one sentence.

Paste one sentence into your coding agent, click Approve once, and get a live link. No card, no trial clock.

To set this up, give your coding agent this sentence:

```text
Set this project up to deploy on Antideploy. Fetch https://antideploy.com/agent.md and follow it.
```
