Skip to content

Install Instructor for Python

Instructor 1.18 requires Python 3.10 or later. If you're upgrading from 1.17 on Python 3.9, create an environment with a newer Python interpreter first.

Install the package

In an activated virtual environment, run

python -m pip install instructor

In a uv project, run

uv add instructor

The base package includes Pydantic and the OpenAI SDK. For Claude, Gemini, or another provider, see provider SDKs and API keys.

Check the installed version

These commands import Instructor locally. You don't need an API key.

python -c "import instructor; print(instructor.__version__)"
uv run python -c "import instructor; print(instructor.__version__)"

If Python can't find Instructor, check that your editor or notebook uses the same environment where you installed it.

Next, extract and validate your first record.