Hello, is there a way to create a configure a Conda environment in KNIME which is effectively pre-set up? I’m creating a workflow I want to share with other people but want to avoid other users having to go through the same set up process but I need to use Conda since there are libraries I need that aren’t available within the bundled version.
Thanks
In KNIME, you can create a pre-configured Conda environment for your workflow and share it with others. Here’s how you can do it:
- Set up your desired Conda environment with all the necessary libraries and dependencies.
- Export the Conda environment as a YAML file. You can do this by running the command
conda env export > environment.yml
in your terminal. - In KNIME, go to File > Preferences > KNIME > Python.
- Click on “Add” to add a new Python environment.
- Choose “Conda Environment” and provide a name for the environment.
- In the “YAML File” field, browse and select the exported environment.yml file.
- Click “Apply” and “OK” to save the configuration.
Now, when you share your workflow, others can import the pre-configured Conda environment in KNIME by following these steps:
- In KNIME, go to File > Preferences > KNIME > Python.
- Click on “Add” to add a new Python environment.
- Choose “Conda Environment” and provide a name for the environment.
- In the “YAML File” field, browse and select the same environment.yml file.
- Click “Apply” and “OK” to save the configuration.
By sharing the pre-configured Conda environment, you ensure that other users can easily reproduce your workflow without going through the set-up process themselves.
Thanks @prashant7526, I’m trying to avoid as much configuration as possible as it can get confusing for people not familiar with KNIME. Is there a way to store the YAML file in the workflow folder and use a node to change to a Conda Environment and select the YAML file?
@TPattison glad you asked. I have written an article about Conda and KNIME *1). To store a conda environment you have created you can use the Conda Environment Propagation – KNIME Community Hub. The packages might be specific to your operating system so you might need one for each.
*1) KNIME and Python — Setting up and managing Conda environments
I do not think this is currently possible with the Conda Environment Propagation node. You can store the whole environment with all the details but you cannot employ a YAML file directly. Or maybe I do not see it …
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.