Since I have updated the Python Snippet node, it failes even with:
kIn=pyOut
It returns this error:
ERROR PythonSnippetNodeModel File "/tmp/analyze8046917519877201488.py", line 136
ERROR PythonSnippetNodeModel d = {k: d[k].values() for k in d} # convert to dict of lists (as used by the python snippet)
ERROR PythonSnippetNodeModel ^
ERROR PythonSnippetNodeModel SyntaxError: invalid syntax
ERROR Python Snippet Execute failed: No python output table found, check script output
The Knime Python Scripting extension version is 2.0.0.201410070829
The python snippets work just fine here on several computers (though all Macs). The new version verifies whether pandas are installed or not and will either use those or use the old dictionary script. I am wondering whether you have several installations of python, some with some without pandas. The script might then find pandas, but KNIME uses andother instance not linked to the module and fail. Is that a possibility?
niederle, I did what you suggested and reverted to the old python nodes, which work fine, even though I never installed pandas in the first place.
Is it a new dependency?
I am working on Centos6.5 and have only one version of python installed (2.6.6) :
type -a python gives "python is /usr/bin/python".
I would prefer having the new nodes working, as they seem to accept non standard column types (SDF), but still now I can use my snippets again!
Python 2.6 is the standard on CentOS 6.x which quite a few people are using. Therefore still supporting Python 2.6 isn't a bad idea (even if it's certainly a bit annoying from the developers perspective).
The bug was due to dict comprehension missing in python 2.6. I apologize for not having tested the code on 2.6. However I commited a fix earlier today and hope it gets merged soon.
Indeed, Python 2.6 is due to CentOS 6.x, but in my system, I can easily switch from this version to a newer. It is just I have a lot of old workflows I made with this old version of Python and I noticed somes errors when I switched to Python 3.x.
I will probably stop using Python 2.6 with Knime 2.10.
I just installed Knime 3.1 to see how new python snippets can handle my python 2.7.
I noticed that they don't seem to support multi-line either as input or as output (executed workflow attached):
ERROR KNIME-Worker-3 Python Snippet Execute failed: String value can't be null.
Is there a way to fix this? For now when I want to use python on SDF within Knime, I replace all "\n" by "#" for python snippets input, then restore "\n" within the node to execute my commands (with RDKit), then replace again "\n" by "#" for output....
However, switching from multi-line to single line all the time does not look like a good idea... Any idea how to fix this? I can run the workflow without any problem with Knime 2.11.
Thank you for your help!
Jose Manuel
Additional informations:
OS: CentOS 6.7 (Final)
python2.7 installed with anaconda, pandas and protobuf installed
When I start Knime, I get the following messages in terminal:
[josemanuel@desktop knime-full_3.1.0]$./knime
CompilerOracle: exclude javax/swing/text/GlyphView.getBreakSpot
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
WARN KNIME-Worker-1 TipsAndNewsInjector Could not modify intro page: Read timed out
---Registering Weka Editors---
### Excluding compile: javax.swing.text.GlyphView::getBreakSpot