This workflow shows how to create complex plots using your favorite python package. In this example, seaborn python package is used to create a 2D kernel density estimate (KDE) plot.
Requirements:
- KNIME Python Integration
- seaborn package
How to install: https://seaborn.pydata.org/installing.html
Hi thanks for the example but i’m running in some trouble in the execution of the seaborn part.
The error i have in console is:
ERROR Python View 5:4 Execute failed: An exception occured while running the Python kernel. See log for details.
In KNIME log the error is:
2021-11-04 15:52:23,090 : ERROR : KNIME-Worker-16-Python View 5:4 : : Node : Python View : 5:4 : 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]
From my side:
python is installed and the anaconda environment is properly set (all the python scripts that are not involving a graph output are working fine)
seaborn is installed in the apropriate environment.
Platform is windows 10 python 3.6.13 (python 2 not installed)
This looks like a hard crash of the Python process to me. Is there any chance that there is more useful information in the knime.log file before that error, i.e. further up in the log file?
here is the full log since installed Knime.
Many thanks for help !!!
The strange thing is that all python scripts not involving a graphical output are working well !