Installation
Set up Python, the Imperal SDK, and your editor for extension development
This page covers the tooling. If you've already done Quick Start and your pip install imperal-sdk worked, you can skip to Your First Extension.
Requirements
| Requirement | Minimum | Recommended |
|---|---|---|
| Python | 3.11 | 3.12 or 3.13 |
| pip | 24.0 | latest |
| Operating system | macOS / Linux / Windows (WSL recommended) | macOS or Linux |
| Editor | any | VS Code or PyCharm with Pylance |
Why Python 3.11+?
The SDK uses modern type hints (X | None), structural pattern matching, and asyncio.TaskGroup. 3.11 is the floor.
Install Python
Use Homebrew for a clean, isolated install:
brew install python@3.12
python3.12 --version
# Python 3.12.xIf you don't have Homebrew, install it first.
Ubuntu / Debian:
sudo apt update && sudo apt install -y python3.12 python3.12-venv python3-pip
python3.12 --versionArch:
sudo pacman -S python python-pipOther distros: check your package manager or use pyenv for version flexibility.
Strongly recommended: use WSL2 and follow the Linux instructions inside it.
If you must use native Windows, install Python from python.org and ensure "Add Python to PATH" is checked.
Set up a virtual environment
Always use a venv per extension. Never install the SDK system-wide.
mkdir my-extension && cd my-extension
python3.12 -m venv .venv
source .venv/bin/activate # macOS/Linux
# .venv\Scripts\activate # Windows native
pip install --upgrade pipYour shell prompt should now show (.venv).
uv is a Rust-based pip replacement. ~10× faster.
# Install uv (one-time)
curl -LsSf https://astral.sh/uv/install.sh | sh
# Per project:
mkdir my-extension && cd my-extension
uv venv --python 3.12
source .venv/bin/activateUse uv pip install ... everywhere instead of pip install ....
Install the Imperal SDK
pip install imperal-sdkCheck it works:
python -c "import imperal_sdk; print(imperal_sdk.__version__)"The version printed is whatever PyPI currently ships. To upgrade later:
pip install -U imperal-sdkPin in production
In production, pin to the version you tested against in your requirements.txt. The SDK is on a steady release line, but federal-contract changes can land between minor versions. See the changelog for what shipped in each release.
Verify the CLI is reachable
imperal --helpYou should see subcommands like init, build, validate, test, dev, deploy, logs. If not, your venv isn't active.
Editor setup (optional but recommended)
Install:
- Python (Microsoft) — language server
- Pylance — type checking + autocomplete (Pydantic models work great)
- Ruff (Astral) — linting and formatting
Open your extension folder. VS Code prompts to select the interpreter — pick .venv/bin/python.
Open the extension folder as a project. PyCharm auto-detects .venv and offers to use it as the interpreter — accept.
For Pydantic strict checking: Settings → Editor → Inspections → Python → Type checker → strict.
Install pyright language server and configure it via your LSP plugin (coc-pyright, mason-lspconfig, etc).
pip install pyrightWhat's installed
After pip install imperal-sdk you have:
Prop
Type
What's NOT included
The SDK does not bundle:
- A web server (extensions don't need one — the web-kernel calls them in-process)
- A database client (your extension talks to APIs / your own backend)
- The web-kernel itself (production runs on Imperal Cloud servers)
- LLM credentials (BYOLLM users provide their own; everyone else uses platform LLM)