How to Install Apache Airflow® with uv and a Constraints File
Apache Airflow® is a Python package, but installing it with a plain pip install apache-airflow can pull in dependency versions it was never tested with. The official way is to install it with a constraints file: a list that pins every dependency to the version Airflow's release was tested against. This guide installs Airflow 3.4.0 that way with uv, on Python 3.14.
Syntax
uv pip install "apache-airflow==<airflow version>" --constraint "https://raw.githubusercontent.com/apache/airflow/constraints-<airflow version>/constraints-<python version>.txt"
| Part | What it means |
|---|---|
uv pip install | uv's pip-compatible command, which installs packages into the active virtual environment |
"apache-airflow==<airflow version>" | The exact Airflow release, such as 3.4.0 |
--constraint <URL> | A file of pinned versions. uv uses those versions for any package it installs, but doesn't install a package only because it's listed |
<python version> | Your Python's major and minor version, such as 3.14. Each Python version has its own constraints file |
Airflow's installation guide explains why the constraints matter: without them, a plain pip install apache-airflow "will not work or will produce an unusable Airflow installation" from time to time, because Airflow keeps its own dependency ranges open.
Prerequisites
- uv. Check with
uv --version. This guide uses uv 0.13.10. - On Windows, a WSL2 terminal. Airflow doesn't run on Windows directly: its prerequisites page says to use WSL2 or Linux containers.
You don't need Python 3.14 installed: uv downloads it in Step 1 if it's missing.
Step 1: Create a Virtual Environment on Python 3.14
In an empty project folder:
uv venv --python 3.14
Using CPython 3.14.10
Creating virtual environment at: .venv
Activate with: source .venv/bin/activate

A virtual environment is a folder, .venv, with its own Python and its own packages, so Airflow's dependencies don't mix with anything else on your computer. --python 3.14 picks the Python version: Airflow 3.4.0 supports Python 3.11, 3.12, 3.13 and 3.14.
Step 2: Activate It
source .venv/bin/activate
Your prompt now starts with the folder's name in parentheses. From here on, python and the airflow command come from .venv.
Step 3: Build the Constraints URL
These are the lines from Airflow's Quick Start. They put the two version numbers into the URL for you:
AIRFLOW_VERSION=3.4.0
PYTHON_VERSION="$(python -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")')"
CONSTRAINT_URL="https://raw.githubusercontent.com/apache/airflow/constraints-${AIRFLOW_VERSION}/constraints-${PYTHON_VERSION}.txt"
echo "$CONSTRAINT_URL"
https://raw.githubusercontent.com/apache/airflow/constraints-3.4.0/constraints-3.14.txt

PYTHON_VERSION asks Python itself for its version, so the URL always matches the environment you activated. The URL points at a file in Airflow's GitHub repository, tagged for the 3.4.0 release.
Step 4: Install Airflow
uv pip install "apache-airflow==${AIRFLOW_VERSION}" --constraint "${CONSTRAINT_URL}"
Resolved 132 packages in 2.76s
Prepared 132 packages in 7.93s
Installed 132 packages in 183ms
+ alembic==1.20.1
+ apache-airflow==3.4.0
+ apache-airflow-core==3.4.0
+ apache-airflow-providers-common-compat==1.23.0
+ apache-airflow-providers-common-io==1.11.0
+ apache-airflow-providers-common-sql==2.4.0
+ apache-airflow-providers-smtp==3.2.0
+ apache-airflow-providers-standard==1.21.0
+ apache-airflow-task-sdk==1.4.0
+ fastapi==0.162.0
+ pendulum==3.3.0
+ pydantic==2.14.2
+ sqlalchemy==2.0.55
+ structlog==26.1.0
+ uvicorn==0.54.0
...

uv installed 132 packages in about 11 seconds, with an empty download cache. The excerpt shows the parts that matter most:
| Package | What it is |
|---|---|
apache-airflow | A small package that pulls in the rest |
apache-airflow-core | The scheduler, the API server and UI, the Dag processor and the metadata database code |
apache-airflow-task-sdk | What your Dags import, as from airflow.sdk import dag, task |
apache-airflow-providers-* | Five providers that ship with Airflow, such as standard with its common operators |
fastapi, uvicorn | The web server behind the API and the UI |
sqlalchemy, alembic | The metadata database and its upgrades |
Every version in the list comes from the constraints file, so you get the same set Airflow 3.4.0 was tested with.
Step 5: Check the Version
export AIRFLOW_HOME="$PWD"
airflow version
2026-12-01T03:24:27.192876Z [warning ] FileType is deprecated. Simply open files after parsing arguments. [py.warnings] category=PendingDeprecationWarning filename=/Users/you/source/airflow-uv-install/.venv/lib/python3.14/site-packages/airflow/cli/cli_config.py lineno=662
2026-12-01T03:24:27.193372Z [warning ] FileType is deprecated. Simply open files after parsing arguments. [py.warnings] category=PendingDeprecationWarning filename=/Users/you/source/airflow-uv-install/.venv/lib/python3.14/site-packages/airflow/cli/cli_config.py lineno=889
3.4.0

The last line, 3.4.0, is the installed version. The export line first tells Airflow to keep its files in this folder instead of creating ~/airflow. How to Set AIRFLOW_HOME for Apache Airflow® explains it.
The two lines before it are FileType is deprecated warnings, which every airflow command prints on Python 3.14. They don't affect anything.
What Happens on Python 3.15
Python 3.15 is newer than any version Airflow 3.4.0 supports. The same steps with --python 3.15 in Step 1 stop at the install:
uv venv --python 3.15
source .venv/bin/activate
AIRFLOW_VERSION=3.4.0
PYTHON_VERSION="$(python -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")')"
CONSTRAINT_URL="https://raw.githubusercontent.com/apache/airflow/constraints-${AIRFLOW_VERSION}/constraints-${PYTHON_VERSION}.txt"
uv pip install "apache-airflow==${AIRFLOW_VERSION}" --constraint "${CONSTRAINT_URL}"
Using CPython 3.15.2 interpreter at: /Library/Frameworks/Python.framework/Versions/3.15/bin/python3.15
Creating virtual environment at: .venv
Activate with: source .venv/bin/activate
error: Error while accessing remote requirements file: https://raw.githubusercontent.com/apache/airflow/constraints-3.4.0/constraints-3.15.txt

There's no constraints file for Python 3.15, so the URL doesn't exist and uv stops. Airflow's Quick Start describes exactly this error and the fix: recreate the virtual environment with a supported Python. Delete .venv and start again from Step 1 with --python 3.14.
Common Mistakes
| Mistake | What happens | Do this instead |
|---|---|---|
pip install apache-airflow with no constraints | Dependencies resolve to their newest versions, which Airflow may not work with | Always pass --constraint |
| Typing the Python version in the URL by hand, then switching Python | The constraints don't match the environment | Build the URL with PYTHON_VERSION from the active Python |
Running airflow before activating .venv | command not found: airflow | source .venv/bin/activate first |
| Using Python 3.15 | error: Error while accessing remote requirements file | Use Python 3.11 to 3.14 |
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
error: Error while accessing remote requirements file: …constraints-3.15.txt | The environment's Python isn't supported by this Airflow release | Recreate .venv with uv venv --python 3.14 |
FileType is deprecated warnings before every command | Every airflow command prints them on Python 3.14 | Nothing to fix: they don't affect the command |
~/airflow appears in your home folder | An airflow command ran without AIRFLOW_HOME | Export AIRFLOW_HOME first, and delete ~/airflow if you don't need it |
FAQ
Can I use pip instead of uv?
Yes. Airflow's Quick Start has the same steps for pip: python3 -m venv .venv, then pip install with the same --constraint URL.
Does Apache Airflow® cost anything?
No. It's open source under the Apache License 2.0, and it runs on your own computer.
Why is apache-airflow so small, and apache-airflow-core so big?
apache-airflow is a thin package that depends on apache-airflow-core, apache-airflow-task-sdk and the providers that ship with Airflow. The code is in those packages.
Conclusion
uv venv --python 3.14 created the environment, the Quick Start's three lines built the constraints URL for Airflow 3.4.0 and Python 3.14, and uv pip install with --constraint installed 132 pinned packages. airflow version printed 3.4.0. On Python 3.15 the install stops, because no constraints file exists for it yet.
Additional Resources
- Quick Start — the official install and first start.
- Installation from PyPI — constraints files explained.
- Prerequisites — supported Python versions and operating systems.
Apache®, Apache Airflow and Airflow® are either registered trademarks or trademarks of The Apache Software Foundation in the United States and/or other countries. No endorsement by The Apache Software Foundation is implied by the use of these marks.
