Protobuf issue when setting up Python on KNIME

Hi,

 

I am trying to setup Python (version 3.4.3) on KNIME. I started by installing Anaconda3-2.3.0. Set all the path variables. I followed three different methods to setup Python on KNIME but none of them worked:

1. Installed the protobuf library using: 'conda install -c https://conda.binstar.org/dhirschfeld protobuf'. This command installs protobuf: 3.0.0a3.post418+g0cb84ee-py34_0 package

However, when including python.exe's path in KNIME, I get the following error: 'Error while trying to load protobuf: name 'unicode' is not defined. The minimum required protobuf version is 2.5.0.'

2. I also followed all the instructions given on the following website, several times (uninstalling and restarting the setup process), but still it doesnt work: http://script-orgmedchem.blogspot.co.uk/2014/12/knime-python-nodes-and-anaconda-virtual.html

3. Then I  removed the protobuf packages from Anaconda and installed using: pip install protobuf. This installs protobuf-2.6.1. But still I get an error and this time it says: 'Error while trying to load protobuf: invalid syntax (pythin_message.py, line 848). The minimum required protobuf version is 2.5.0.' My version is higher than 2.5.0 but still the error.

 

It will be great if someone can help me with this.

 

Thank you..

 

 

 

Hi,

our Python integration only support Python 2 (not 3)

We will shortly publish a more detailed explanation for setting up Python with KNIME. I cannot publish it now, but if you want I can sent it to you via EMail.

Best, Iris

Hi Iris.. Thank you very much for getting back to me. Yes,. that will be great. I will contact you with my email address. Thanks again..

Hi Iris,

I have the same problem with python 2.7 and knime 2.12.1. could you send me detailed explanation for setting up Python with KNIME via Email? I would appreciate any help.

Best Piotr

Mail

Hi Piotr,

we published the setup steps and you can find them here:

https://www.knime.org/blog/how-to-setup-the-python-extension

Best, Iris

Hi Iris

Thanks a lot

Best Piotr

Hi Iris,

I have the same problem with the error message "Library google.protobuf is missing,..". But unfortunately I have no idea how to install(?) protobuf. Could you please give me a hint how to fix it or better a complete instruction? At the moment there are installed both versions of Anaconda (2 and 3).

Thank you in advance.

Best, Rolf

Hi,

My python version is 3.6.1 .Is knime supports this ?

Error while trying to load protobuf:
name 'unicode' is not defined
The minimum required protobuf version is 2.5.0

 

I am facing above issue .Could any body help to solve this problem?

 

Thank you in advance.

Hey,

The KNIME Analytics Platform v3.3 does not support Python 3. Regarding protobuf I think this thread contains some good pointers: https://tech.knime.org/forum/knime-general/python-script-node-for-python-v3

Best,
Ferry

Is it possible to use a virtual environment with Knime so I can install the protobuf into a contained environment? The instructions https://www.knime.org/blog/how-to-setup-the-python-extension seem to point to installing it in the root but I'd like to setup a knime friendly virtual environment not just use the root of my python2 installation

Is that possible?

Hi,

If it is of any use: I followed the most recent instructions for getting Python to work with Knime 3.5.1 as outlined here:

https://www.knime.com/blog/setting-up-the-knime-python-extension-revisited-for-python-30-and-20

I had anaconda3 installled (Ubuntu 16.04 LTS) and created environments for both python 3.5 and 2.7, exactly as described, and created shell scripts which I configured under the Knime Python preferences.

But then I still got the protobuf error message:

ERROR SyGMa Metabolites    0:1        Execute failed: Could not start python kernel:
Library google.protobuf is missing, required minimum version is 2.5.0

After some googling I came across Anaconda Navigator,  a graphical interface for among others management of Python environments:

https://anaconda.org/anaconda/anaconda-navigator

Install via 'conda install -c anaconda anaconda-navigator' and then start via 'anaconda-navigator'. Under Environments at the top-left you should see the py27_knime and py35_knime environments you created earlier. Select one of the Knime environments, and then 'Not installed' from the drop-down menu. Search for 'protobuf'. Then select the protobuf packages found and hit 'Apply' at the bottom.

After this I could run the Sygma Metabolites package without any problems.

Cheers/Evert

Of course if you start from scratch you can avoid this procedure by adding protobuf to the enviroments from the beginning:

conda create -y -n py27_knime python=2.7 pandas jedi protobuf