Add Packages to a Pixi or Conda Environment
This guide explains how to add Python packages to an existing environment, whether it is managed by Pixi (via the Python Environment Provider node) or by Conda.
Adding packages to a Pixi environment
The Python Environment Provider node allows you to manage dependencies directly within your workflow. You can specify which libraries your Python scripts will use using three different input modes.
- Double-click the Python Environment Provider node to open the configuration dialog.
- Select your preferred input mode to add packages:
Packages mode
This is the simplest way to add individual packages.
- In the Packages tab, click Add package.
- Type the name of the package (e.g.,
xgboost). - (Optional) Specify a Min version and/or Max version to ensure compatibility.
- (Optional) Choose the Source for the package (e.g.,
Conda).
TOML editor
For more advanced users, you can specify channels and dependencies in TOML format:
toml
[workspace]
channels = ["knime", "conda-forge"]
platforms = ["win-64", "linux-64", "osx-64", "osx-arm64"]
[dependencies]
python = "3.14.*"
knime-python-base = "5.9.*"
plotly = ">=5.10"YAML editor
Use a Conda-style YAML specification if you are migrating from an existing environment:
yaml
name: myenv
channels:
- knime
- conda-forge
dependencies:
- python=3.14.*
- knime-python-base=5.9.*
- plotly>=5.10Click the Resolve Dependencies button. Pixi will check for compatibility and prepare the environment. If successful, you will see an Environment validated message with the status "Environment resolved successfully. Lock file generated."
Click OK and re-execute the node. The environment will be updated (or recreated) with the new packages.
Adding packages to a Conda environment
If you manage your environment via Conda on the command line, install additional packages into an existing environment with:
bash
conda install --name my_python_env -c conda-forge <package>For example:
bash
conda install --name my_python_env -c conda-forge xgboost=2.0Further information on managing Conda packages can be found in the Conda documentation.
WARNING
Do not install the package knime using pip into the environment that will be used inside KNIME. This causes a name clash and makes importing knime.scripting.io fail. If you accidentally installed it, run pip uninstall knime in your Python environment.
Verifying the installed packages
After modifying the environment you can verify the installation:
- Conda:
conda list --name my_python_env - Inside a Python Script node: add
import <package>; print(<package>.__version__)to your script, click Run all, and check the console output.