Knime Server Python Import Error

I am receiving the following error when I am trying to access my knime workflow deployed on knime server via ReST API.

“Execute failed: Traceback (most recent call last):\n File “/opt/knime-full_3.5.2/plugins/org.knime.python2_3.5.0.v201712011355/py/”, line 491, in execute\n exec(source_code, self._exec_env, self._exec_env)\n File “”, line 17, in \nImportError: No module named ‘sklearn’\n”

The knime server is hosted on AWS EC2, I accessed the server through SSH, installed the module via pip, and verified the installation by importing the library to python console and everything worked fine. I am assuming it is not using the system default python, need help configuring the same. Thank you.

Hi there,

On the EC2 instance, please check the file contents of /srv/knime_server/config/preferences.epf.

There should be lines like:

The commands in: /home/knime/python/
activate the conda environment like: source /home/knime/python/anaconda/bin/activate py35_knime

So you’ll need to make sure that you install sklearn into that environment. Something like:
source /home/knime/python/anaconda/bin/activate py35_knime
conda install -c anaconda scikit-learn

Alternatively (but not recommended) you may choose to change the path in /instance/org.knime.python2/python3Path= to point to the system python, where you install sklearn already.



Thank you Jon, that did solve the problem I was facing. However, I would like to mention that I am trying to access the workflow using rest api, most of the rest end points work, but when I make a post request to initiate a new job, I am getting the following error,
KNIME Slave 4.7.2 is not compatible with KNIME Server 4.6.1

Hi there,

In this case it looks like the executor is updated ahead of the KNIME Server. You have three options.

  1. Update the KNIME Server to 4.7.3 (latest version). See details here:
  2. Revert the executor to 3.5.x. If you have a backup that is easy.
  3. Uninstall the 4.7.2 slave feature group, and install the 4.6.1 slave feature group. See details in: (around page 18)

Drop me a DM if you don’t have access to the software download pages.



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