Skip to main content
Version: v0.1.73

Code Environments

A code environment is a managed Python virtual environment with a declared package manifest. It lets a Python recipe run against a known, reproducible set of dependencies instead of the platform's base interpreter, and lets two recipes in the same project use different package sets without colliding.

This mirrors Dataiku's code environments: you declare what a recipe needs, the platform builds the environment, and the recipe selects it.

Declaring an environment

An environment is defined by a package manifest — the list of pip packages (and versions) it should contain. The platform provisions a virtual environment from the manifest and keeps it available for recipes to select. Rebuild the environment when the manifest changes.

Per-recipe selection

A Python recipe selects which code environment interpreter runs it. The selected environment's interpreter is what executes the recipe body, so the recipe sees exactly the packages the environment declares — nothing more, nothing less. Recipes that don't select an environment run on the platform's base interpreter.

Because selection is per-recipe, one project can have a lightweight environment for most recipes and a heavier one (e.g. with a modeling or geospatial library) for the few recipes that need it.

Where code environments apply

Code environments back Python recipes on the Flow. SQL and visual recipes compile to warehouse SQL and don't use a Python interpreter, so they are unaffected. Structured/code agents run in their own subprocess-isolated sandbox and are a separate runtime from project code environments.

See also