---
title: "Installing and Setting Up the ADK Environment with Python 3.11+ and uv"
date: "2026-11-24T04:10:00+07:00"
description: "Set up a Google ADK development environment from scratch: Python 3.11+, the google-adk package, constraints files, adk create, your API key and first run."
author: "AI Assistant"
image: "https://blog.redlinesoft.net/images/post/installing-adk-python-uv.jpg"
alt: "Terminal showing Python virtual environment setup and ADK installation commands"
tags: ['google-adk', 'python', 'uv', 'environment-setup', 'tutorial']
---

Getting a clean ADK environment is a ten-minute job if you get three things right: the Python version, the package constraints, and where you launch the `adk` CLI from. This tutorial walks through both supported installation paths — the vanilla `venv` + `pip` route from the official docs, and a faster `uv`-based workflow — then scaffolds a project with `adk create` and runs it.

The package you are installing is `google-adk`, which provides the `adk` command-line interface. It is Apache-2.0 licensed, released roughly every two weeks, and the README's install section is the source of truth for version requirements.

## Prerequisites: Python 3.11 or later

There is a small discrepancy worth knowing about. The Python quickstart page says "Python 3.10 or later," but the adk-python README states **"Requirements: Python 3.11+"** — and Google ships companion `constraints-3.11.txt` through `constraints-3.15.txt` files starting at 3.11. Follow the README: use Python 3.11 or newer.

Check what you have:

```bash
python3 --version        # expect 3.11+
which python3
```

If you manage Python with uv, installing the interpreter is one command:

```bash
uv python install 3.11   # downloads a managed CPython 3.11
uv python list            # see installed and available versions
```

## Path A: venv + pip (the documented default)

The official installation page recommends a virtual environment before anything else:

```bash
python3 -m venv .venv
source .venv/bin/activate          # macOS / Linux
# .venv\Scripts\Activate.ps1        # Windows PowerShell

pip install google-adk
pip show google-adk                # optional: verify the install
```

For transitive dependency protection, the README recommends installing with the constraints file matching your interpreter:

```bash
curl -o constraints-3.11.txt https://raw.githubusercontent.com/google/adk-python/main/constraints-3.11.txt
pip install google-adk -c constraints-3.11.txt
rm constraints-3.11.txt
```

Optional integrations install as extras: `pip install "google-adk[extensions]"` (other extras used later include `google-adk[gcp]` for Vertex AI session services and `google-adk[db]` for `DatabaseSessionService`).

## Path B: uv (same result, less friction)

uv can provision the interpreter, the virtual environment, the lockfile and the dependency in one flow. From a fresh directory:

```bash
uv python install 3.11
uv init adk-playground
cd adk-playground
uv add google-adk            # resolves + installs into .venv, writes uv.lock
uv run python -c "import google.adk; print('ok')"
```

Notes on this path:

- `uv init` creates `pyproject.toml` and `.python-version`; pin the interpreter with `echo "3.11" > .python-version` so every teammate and CI job agrees.
- `uv add google-adk -c constraints-3.11.txt` applies the same constraint file the README ships, if you want that extra safety.
- `uv run adk ...` executes the CLI inside the project environment, so you never have to think about activating anything: `uv run adk --help`.
- `uv lock --upgrade-package google-adk` upgrades ADK alone while leaving the rest of the lockfile untouched — handy given the bi-weekly release cadence.

## Scaffold the agent project

With ADK on your PATH (or via `uv run`), generate a project:

```bash
adk create my_agent
```

You get exactly what the quickstart promises — `root_agent` in `agent.py` is the only required element:

```text
my_agent/
    agent.py      # main agent code (defines root_agent)
    .env          # API keys or project IDs
    __init__.py
```

## Set your API key

The default model is a Gemini model, so you need a key from the Google AI Studio API Keys page. Write it into the project's `.env` file:

```bash
echo 'GOOGLE_API_KEY="YOUR_API_KEY"' > my_agent/.env
```

Keep `.env` out of version control. If you use a different provider, ADK's model docs cover OpenAI, Anthropic, Ollama, vLLM and LiteLLM configurations.

## Run it

Two entry points, both from the **parent directory that contains `my_agent/`**:

```bash
adk run my_agent             # interactive CLI
adk web --port 8000          # browser dev UI at http://localhost:8000
```

`adk run` is a terminal chat loop; `adk web` gives you the developer UI for inspecting events, state changes and agent definitions. The docs are emphatic about one thing: **ADK Web is not meant for production deployments** — development and debugging only. Production paths are `adk api_server`, `adk deploy docker --with_ui`, `adk deploy cloud_run --with_ui`, or the managed Agent Runtime.

## Common pitfalls

| Symptom | Cause and fix |
|---|---|
| `adk: command not found` | Package installed outside the active env — re-activate `.venv` or prefix with `uv run` |
| Web UI shows no agents | You launched `adk web` inside the agent folder; run it from the parent directory |
| Auth errors on first call | Missing/misspelled `GOOGLE_API_KEY` in `my_agent/.env`, or key not yet active in AI Studio |
| Dependency conflicts on upgrade | Install with the version-matched `constraints-3.1x.txt` file from the README |
| Works locally, fails in CI | CI picked a different Python; pin `.python-version` and commit it |

**Takeaway:** install ADK on Python 3.11+ with `pip install google-adk` (ideally constrained by the README's `constraints-3.1x.txt`) or `uv add google-adk` in a pinned project, scaffold with `adk create`, drop `GOOGLE_API_KEY` into `.env`, and launch `adk run` or `adk web` from the parent directory — a repeatable setup your whole team can share through a lockfile.

## Sources
- https://github.com/google/adk-python
- https://adk.dev/get-started/python/
- https://adk.dev/get-started/installation/
- https://docs.astral.sh/uv/getting-started/
- https://docs.astral.sh/uv/guides/projects/
