Error with Python Integration

Hi All,

Here at Evotec we try to use the "Knime Python Integration" (  KNIME Python Integration    3.3.0.v201611242050    org.knime.features.python.feature.group    KNIME GmbH, Konstanz, Germany)

Our knime version is 3.3.2.

After setting the Python preferences as described at https://www.knime.com/blog/how-to-setup-the-python-extension 

we obtained the following message below : 

Have you a solution to run a simple "Python Script (1⇒1)" node in Knime ?

FRC.

 

The script  /site/tl/home/fchalaoux/launch_python.sh

======================================

#!/bin/bash  
# start by making sure that the anaconda directory is on the PATH  
# so that the source activate command works.  
# This isn't necessary if you already know that  
# the anaconda bin dir is on the PATH  
export PATH="/site/tl/app/x86_64/tools/anaconda/python2-4.4.0/bin/:$PATH" 

#module load anaconda/python2-4.4.0
python "$@" 1>&1 2>&2

 

ERROR

======

ERROR Python Script (1⇒1)  0:2        Execute failed: Could not start python kernel
ERROR PythonKernel                    /site/tl/app/x86_64/discovery/knime/desktop/3.3.2/plugins/org.knime.python_3.3.0.v201611242050/py/PythonKernel.py:40: FutureWarning: The pandas.tslib module is deprecated and will be removed in a future version.
  from pandas.tslib import Timestamp
Traceback (most recent call last):
  File "/site/tl/app/x86_64/discovery/knime/desktop/3.3.2/plugins/org.knime.python_3.3.0.v201611242050/py/PythonKernel.py", line 48, in <module>
    import jedi
  File "/site/tl/app/x86_64/tools/anaconda/python2-4.4.0/lib/python2.7/site-packages/jedi/__init__.py", line 41, in <module>
    from jedi.api import Script, Interpreter, NotFoundError, set_debug_function
  File "/site/tl/app/x86_64/tools/anaconda/python2-4.4.0/lib/python2.7/site-packages/jedi/api/__init__.py", line 23, in <module>
    from jedi.api import classes
  File "/site/tl/app/x86_64/tools/anaconda/python2-4.4.0/lib/python2.7/site-packages/jedi/api/classes.py", line 14, in <module>
    from jedi.evaluate import representation as er
  File "/site/tl/app/x86_64/tools/anaconda/python2-4.4.0/lib/python2.7/site-packages/jedi/evaluate/__init__.py", line 69, in <module>
    from jedi.evaluate import representation as er
  File "/site/tl/app/x86_64/tools/anaconda/python2-4.4.0/lib/python2.7/site-packages/jedi/evaluate/representation.py", line 52, in <module>
    from jedi.evaluate import docstrings
  File "/site/tl/app/x86_64/tools/anaconda/python2-4.4.0/lib/python2.7/site-packages/jedi/evaluate/docstrings.py", line 46, in <module>
    from numpydoc.docscrape import NumpyDocString
  File "/site/tl/app/x86_64/tools/anaconda/python2-4.4.0/lib/python2.7/site-packages/numpydoc/__init__.py", line 3, in <module>
    from .numpydoc import setup
  File "/site/tl/app/x86_64/tools/anaconda/python2-4.4.0/lib/python2.7/site-packages/numpydoc/numpydoc.py", line 32, in <module>
    from sphinx.util.compat import Directive
  File "/site/tl/app/x86_64/tools/anaconda/python2-4.4.0/lib/python2.7/site-packages/Sphinx-1.5.6-py2.7.egg/sphinx/util/__init__.py", line 28, in <module>
    from docutils.utils import relative_path
  File "/site/tl/app/x86_64/tools/anaconda/python2-4.4.0/lib/python2.7/site-packages/docutils/utils/__init__.py", line 20, in <module>
    import docutils.io
  File "/site/tl/app/x86_64/tools/anaconda/python2-4.4.0/lib/python2.7/site-packages/docutils/io.py", line 18, in <module>
    from docutils.utils.error_reporting import locale_encoding, ErrorString, ErrorOutput
  File "/site/tl/app/x86_64/tools/anaconda/python2-4.4.0/lib/python2.7/site-packages/docutils/utils/error_reporting.py", line 60, in <module>
    codecs.lookup(locale_encoding or '') # None -> ''
NameError: name 'locale_encoding' is not defined

The solution is here :

https://coderwall.com/p/-k_93g/mac-os-x-valueerror-unknown-locale-utf-8-in-python

 

Have fun, FR

I'm also seeing intermittent ' Could not start python kernel ' errors. Almost always will be OK if I re-execute the offending node. I've seen this with several different scripts, and it is quite frustrating, especially when it holds up a long running loop.

I'm running knime 3.4.0 on Windows 10, and have knime linked to anaconda python 2.7.13