This guide shows you how to install Xorq and confirm the installation works. It also covers the optional extras that add support for specific backends.
If you want to connect to a database after installing, see Connect to a backend.
Prerequisites
- Python 3.10 or higher. Check with
python --version; if you’re below 3.10, grab a newer release from the Python downloads page.
pip or uv.
Steps
1. Install the package
The base package includes the core library, an embedded DataFusion backend, and Pandas support.
For a standalone install:
For a project with locked dependencies:
uv init my-xorq-project
cd my-xorq-project
uv add xorq
Install the latest development version from GitHub:
pip install git+https://github.com/xorq-labs/xorq.git
For local development, clone and install in editable mode:
git clone https://github.com/xorq-labs/xorq.git
cd xorq
pip install -e ".[examples]"
nix run github:xorq-labs/xorq
2. Verify the installation
Run a query against the embedded backend. It ships with the base package, so no extra setup is needed.
import xorq.api as xo
con = xo.connect()
iris = xo.examples.iris.fetch(backend=con)
result = (
iris.filter(xo._.sepal_length > 5)
.group_by("species")
.agg(total_width=xo._.sepal_width.sum())
.execute()
)
print(result)
species total_width
0 Virginica 146.2
1 Versicolor 131.8
2 Setosa 81.7
If you see sepal widths aggregated by species, the installation works.
Troubleshooting
ModuleNotFoundError: No module named 'xorq': the install landed in a different environment than the one running your code. Compare which python against the environment you installed into, or run pip show xorq to see where it went.
xo.duckdb.connect() (or another backend) raises an import error: the backend extra isn’t installed. Install it from the extras table.
Build errors during pip install: your Python is probably older than 3.10. Check python --version and upgrade if needed.