error on all pythonview examples

Hi all, I have some troubles in getting the python view examples working, tested seaborn and matplot lib and in both cases i have this errror:

ERROR Python View 5:1 Execute failed: An exception occured while running the Python kernel. See log for details.

In knime error log i have this:
2021-11-04 13:45:49,325 : ERROR : KNIME-Worker-32-Python View 5:1 : : Node : Python View : 5:1 : Execute failed: An exception occured while running the Python kernel. See log for details.
org.knime.python2.kernel.PythonIOException: An exception occured while running the Python kernel. See log for details.
at org.knime.python2.util.PythonUtils$Misc.executeCancelableUnwrapExecutionException(PythonUtils.java:310)
at org.knime.python2.util.PythonUtils$Misc.executeCancelable(PythonUtils.java:283)
at org.knime.python2.kernel.PythonKernel.executeCommandCancelable(PythonKernel.java:1482)
at org.knime.python2.kernel.PythonKernel.execute(PythonKernel.java:1413)
at org.knime.python2.nodes.view.PythonViewNodeModel.execute(PythonViewNodeModel.java:110)
at org.knime.core.node.NodeModel.executeModel(NodeModel.java:549)
at org.knime.core.node.Node.invokeFullyNodeModelExecute(Node.java:1259)
at org.knime.core.node.Node.execute(Node.java:1039)
at org.knime.core.node.workflow.NativeNodeContainer.performExecuteNode(NativeNodeContainer.java:559)
at org.knime.core.node.exec.LocalNodeExecutionJob.mainExecute(LocalNodeExecutionJob.java:95)
at org.knime.core.node.workflow.NodeExecutionJob.internalRun(NodeExecutionJob.java:201)
at org.knime.core.node.workflow.NodeExecutionJob.run(NodeExecutionJob.java:117)
at org.knime.core.util.ThreadUtils$RunnableWithContextImpl.runWithContext(ThreadUtils.java:365)
at org.knime.core.util.ThreadUtils$RunnableWithContext.run(ThreadUtils.java:219)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
at org.knime.core.util.ThreadPool$MyFuture.run(ThreadPool.java:123)
at org.knime.core.util.ThreadPool$Worker.run(ThreadPool.java:246)
Suppressed: org.knime.python2.kernel.PythonKernelCleanupException: Failed to clean up Python. See log for details.
at org.knime.python2.kernel.PythonKernel.close(PythonKernel.java:1528)
at org.knime.python2.nodes.view.PythonViewNodeModel.execute(PythonViewNodeModel.java:120)
… 13 more
Caused by: java.lang.Exception: Failed to receive message from Python or forward received message. Cause: Connection reset
at org.knime.python2.kernel.messaging.AbstractMessageLoop.throwExceptionInLoop(AbstractMessageLoop.java:76)
at org.knime.python2.kernel.messaging.DefaultMessageReceiverLoop.loop(DefaultMessageReceiverLoop.java:98)
at org.knime.python2.kernel.messaging.AbstractMessageLoop.doLoop(AbstractMessageLoop.java:175)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
Suppressed: java.lang.Exception: Failed to distribute message from Python. Cause: Message receiver loop terminated.
at org.knime.python2.kernel.messaging.AbstractMessageLoop.throwExceptionInLoop(AbstractMessageLoop.java:76)
at org.knime.python2.kernel.messaging.MessageDistributorLoop.loop(MessageDistributorLoop.java:93)
… 4 more
Caused by: java.io.IOException: Message receiver loop terminated.
at org.knime.python2.kernel.messaging.DefaultMessageReceiverLoop.receive(DefaultMessageReceiverLoop.java:82)
at org.knime.python2.kernel.messaging.MessageDistributorLoop.loop(MessageDistributorLoop.java:82)
… 4 more
Suppressed: [CIRCULAR REFERENCE: java.lang.Exception: Failed to distribute message from Python. Cause: Message receiver loop terminated.]
Caused by: java.net.SocketException: Connection reset
at java.base/java.net.SocketInputStream.read(Unknown Source)
at java.base/java.net.SocketInputStream.read(Unknown Source)
at java.base/java.io.DataInputStream.readFully(Unknown Source)
at java.base/java.io.DataInputStream.readFully(Unknown Source)
at org.knime.python2.kernel.messaging.PythonMessagingUtils.readInt(PythonMessagingUtils.java:91)
at org.knime.python2.kernel.messaging.DefaultMessageReceiver.receive(DefaultMessageReceiver.java:80)
at org.knime.python2.kernel.messaging.DefaultMessageReceiverLoop.loop(DefaultMessageReceiverLoop.java:92)
… 4 more
Caused by: org.knime.python2.kernel.PythonIOException: An exception occured while running the Python kernel. See log for details.
at org.knime.python2.kernel.PythonKernel.getMostSpecificPythonKernelException(PythonKernel.java:1722)
at org.knime.python2.kernel.PythonKernel.executeCommand(PythonKernel.java:1449)
at org.knime.python2.kernel.PythonKernel.execute(PythonKernel.java:1397)
at org.knime.python2.kernel.PythonKernel.lambda$8(PythonKernel.java:1413)
at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: [CIRCULAR REFERENCE: java.lang.Exception: Failed to receive message from Python or forward received message. Cause: Connection reset]
.

As side note all the phyton scripts that are not involving visualizations are working well and yes the libraries are installed.
I have tested with the startup script and with the conda environment.

Any help is wellcome !

Hi @Riodda,

thanks for reaching out and thanks for grabbing the logs!
What KNIME and Python versions are you running? We’re currently investigating an issue we sometimes have when saving figures in plotly (e.g. figure.savefig(buffer, format='svg')).
You could try commenting out such lines, to see whether this likely is the same issue.

Additionally, if you are not using Python 3.6, could you try that? Under File > Preferences > KNIME > Python you can conveniently create a new environment.

Kind regards
Marvin

Platform is windows 10 python 3.6.13 (python 2 not installed) knime is the latest. 4.4.2
All the python plots are failing plotly seaborn all. I have errors only on visualizations.
Have a look to this post as well

Hi @Riodda,

thanks for following up and apologies for the wait.
I am still looking into the issue with one of our Python developers, though progress is slow since a new version release is coming up soon.

Could you maybe share a simple workflow that includes the node Conda Environment Propagation – KNIME Hub? (Be sure to select the correct environment if you have multiple set up.)

This makes the Python packages and versions sharable, so that we may be able to recreate your exact setup.

Kind regards
Marvin

1 Like

Hi, the only solution i found was to create a new conda environment, the strange thing is that the packages were installed with the script on the install instruction. Without using the script it worked out fine.
The olnly difference i recon is that with the script the lib version are forced while when i did it manually i installed the latest version.
Cheers.

1 Like