Installation¶
In this tutorial, you will install Semolina and verify it is working. By the end, you will be ready to write your first query.
Prerequisites: Python 3.11 or later.
Install the package¶
pip install semolina
Tip
Use a virtual environment
Always install packages into an isolated virtual environment rather than your system Python:
python -m venv .venv
source .venv/bin/activate # macOS/Linux
.venv\Scripts\activate # Windows
pip install semolina
uv add semolina
Install a backend extra¶
To connect to a real warehouse, install the extra for your backend:
pip install semolina[snowflake]
# or
uv add "semolina[snowflake]"
Installs adbc-poolhouse[snowflake] alongside Semolina.
pip install semolina[databricks]
# or
uv add "semolina[databricks]"
Installs adbc-poolhouse[databricks] alongside Semolina.
pip install semolina[duckdb]
# or
uv add "semolina[duckdb]"
Installs duckdb and pyarrow for local in-memory testing without a warehouse.
pip install semolina[snowflake,databricks]
# or
uv add "semolina[snowflake,databricks]"
To follow the tutorials without a real warehouse, install semolina[duckdb] and
use a local in-memory DuckDB pool. See How to test query code without a warehouse for the
setup pattern.
Optional: formatted codegen output¶
If you plan to generate model classes from existing warehouse views with
semolina codegen, add the codegen-lint extra. It lets
codegen format the generated source with ruff before printing:
pip install semolina[codegen-lint]
# or
uv add "semolina[codegen-lint]"
Codegen works without it, just without the formatting pass.
Verify the installation¶
Run this in your terminal:
python -c "import semolina; print(semolina.__version__)"
You should see:
0.4.0
If the import fails, double-check that you are in the right virtual environment.
Next steps¶
Your installation is ready. Move on to writing your first query:
See also¶
How to generate Semolina model classes from warehouse views – generate Python models from your warehouse schema
How to choose and configure a backend – connect to Snowflake or Databricks