knime-mpicbg / knime-scripting

knime-scripting includes scripting extensions for KNIME to integrate R, Matlab, Python and Groovy scripts. These extensions include a collection of nodes to develop and deploy templates in the respective languages.
https://github.com/knime-mpicbg/knime-scripting/wiki
Other
43 stars 25 forks source link

python nodes do not work with python 3.x but with pyhton 2.x #20

Closed niederle closed 3 years ago

niederle commented 10 years ago

Error message:

ERROR PythonSnippetNodeModel Traceback (most recent call last): ERROR PythonSnippetNodeModel File "/var/folders/aT/aT-JBgnUFAa41sIiC1a8DE+++TQ/-Tmp-/analyze2520056644575458498.py", line 214, in ERROR PythonSnippetNodeModel kIn = read_csv(r"/var/folders/aT/aT-JBgnUFAa41sIiC1a8DE+++TQ/-Tmp-/knime2python2543081995884595474.csv", True) ERROR PythonSnippetNodeModel File "/var/folders/aT/aT-JBgnUFAa41sIiC1a8DE+++TQ/-Tmp-/analyze2520056644575458498.py", line 143, in read_csv ERROR PythonSnippetNodeModel types = get_column_types(csv_filename) ERROR PythonSnippetNodeModel File "/var/folders/aT/aT-JBgnUFAa41sIiC1a8DE+++TQ/-Tmp-/analyze2520056644575458498.py", line 68, in get_column_types ERROR PythonSnippetNodeModel for row in csv_reader: ERROR PythonSnippetNodeModel _csv.Error: iterator should return strings, not bytes (did you open the file in text mode?) ERROR Python Snippet Execute failed: No python output table found, check script output

Reason: csv.reader(open(csv_filename, 'rb'), delimiter=',', quotechar='"')

is correct for 2.x but not for 3.x