Set up Python for an environment
Python nodes, such as the Python Script node, need a Python environment to run. On managed and sovereign environments, provide one with the Python Environment Provider node, which creates the environment for each run.
If your workflow only needs common packages, use the bundled environment instead. It requires no setup. For the included packages, see Bundled packages.
On a sovereign executor, you can also install a permanent environment that you control. For the steps, see Use a permanent Python environment.
Create the environment for each run
The Python Environment Provider node passes a Python environment specification to downstream Python nodes. This option works on both managed and sovereign environments.
To provide a Python environment with this node:
- Add the Python Environment Provider node to the workflow.
- In the node, define the packages your Python scripts need.
- Connect the node to the downstream Python nodes.
The executor creates the environment from scratch each time a downstream Python node runs. When the run ends, the executor discards the environment. For detailed instructions, see Set up Pixi for Python environment management.