Skip to content

Python Environments on Executors

When a workflow runs on a KNIME Executor inside KNIME Business Hub, Python nodes need access to a Python environment. There are three types of environments available on executors, each with different characteristics regarding performance, flexibility, governance, and persistence.

Environment types

Bundled environment

The bundled environment is pre-packaged with KNIME and requires no configuration. It is always available on the executor and does not depend on any external package repositories at runtime. For the list of included packages, see Bundled Packages.

Pre-installed custom environments

Python environments can be embedded into the executor image at build time, using the Execution Image Builder or by installing conda environments directly into a custom image. These environments are available immediately when the executor starts and survive executor restarts.

Pre-installed environments are configured for use in Python Script nodes via:

  • executor preferences (globally for all workflows on that executor)
  • the python3_command flow variable (per workflow)
  • the Conda Environment Propagation node in Check name only mode, which matches a pre-installed environment by name without overwriting it

Pre-installed environments are static: updating them requires rebuilding the executor image. They also increase the size of the executor image.

On-the-fly environments

On-the-fly environments are created during workflow execution using the Conda Environment Propagation node or the Python Environment Provider node. They are not present in the executor image; instead, they are installed at runtime when the workflow runs.

On-the-fly environments are matched to existing environments on the executor by name. Once created, they persist on the executor until it is restarted. In multi-executor setups, each executor instance creates its own copy of the environment independently.

Because environments are matched by name, naming collisions between workflows are possible. A specific naming format helps avoid this:

knimeenv_<workflowName>_<envName>

On-the-fly environments require the executor to have network access to conda and pip package repositories at runtime. In restricted network environments, this requires configuring channel mirrors or proxy settings (see Troubleshooting).

Security

Installing environments at runtime pulls packages from external sources. These packages may be subject to CVEs and can execute code during installation. Consider using vetted mirrors or internal channels.

Comparison

AspectPre-installed environmentsOn-the-fly environments
PerformanceNo install overhead at runtimeSlower on first run; environment must be created
Update flexibilityRequires rebuilding the executor imageChangeable per workflow or per run
GovernanceCentrally defined; easy to auditDecentralized; all workflows can contribute environments
Resilience to restartsSurvive executor restartsLost on restart; recreated on next execution
Multi-executor setupsAvailable on all instances from imageMust be created on each executor instance separately
Runtime network accessNot requiredRequired (conda/pip repositories or configured mirrors)