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/PythonKernel.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.
On the EC2 instance, please check the file contents of /srv/knime_server/config/preferences.epf.
There should be lines like:
/instance/org.knime.python2/defaultPythonOption=python3
/instance/org.knime.python2/python3Path=/home/knime/python/python35.sh
The commands in: /home/knime/python/python35.sh
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