Getting Knime to work with Python on a remote instance

Hello to the Knime community,

I’m trying to have Knime running on an AWS EC2 instance through crontab. I got Knime to work on the EC2, and I also got some workflows to be automatically triggered by cron.

The trouble starts when I have a Knime workflow that uses a python snippet. I installed miniconda, and configured it on Knime. It works when I manually trigger Knime on the EC2 (I have a GUI installed so that helps), but when I set a cronjob to run the workflow, I get the error “Could not start Python executable at the given location (no_conda_environment_selected/bin/python)”.

The command line I use to trigger WFs on the EC2 is (with variables noted as <variable_name>):

<knime_directory> -nosplash -application org.knime.product.KNIME_BATCH_APPLICATION -workflowDir=‘<workflow_dir>’ -reset -nosave -workflow.variable=server_name,‘<server_name>’,String

I tried adding something like:

-Dorg.knime.python.pydev.interpreter=<path_to_minconda_env>

… But it did not do the trick. Any ideas?

Thank you!
Berti

The solution was already on the Knime forum, and I had missed it :slight_smile:

In my case I exported the preferences .epf file with File > Export Preferences
And then pointed to that file when running Knime on the command interface using:

<knime_directory> -nosplash -application org.knime.product.KNIME_BATCH_APPLICATION -workflowDir=‘<workflow_dir>’ -reset -nosave -workflow.variable=server_name,‘<server_name>’,String -preferences=“<path-to-exported-preferences-file>”

All sorted! Cheers
Berti

1 Like

Glad you found it, and thanks for posting to benefit others! :slight_smile:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.