Python Script (Labs) Error: "An exception occured while running the Python kernel. See log for details"

Hello,

I’m unable to use Python Script (Labs) node. When I open the node’s config dialog an error says:
“An exception occured while running the Python kernel. See log for details”

I thought there was a conflict with some libraries in my conda env. I’ve even started from scratch; uninstalling/reinstalling miniconda and creating fresh environments for Python3, Python2, and a separate Python3 env for labs.

I created the current env for Python Script (Labs) via the “New environment” option within KNIME preferences, but I still get the same error.

My version are:
KNIME 4.6.1
conda 22.9.0
python 3.9.13

What is strange is that if I connect a fresh Table Creator node with no data to the Python Script (Labs) node and open it, it successfully loads input data and I can even print to the console. When I try to connect anything with data to the input of the Python Script (Labs) node, I get the above error again.
The following are the logs from when I print “Hello” (with no data connected to input), then connect a node with data to the input of Python Script (Labs):

INFO Python Script (Labs) 5:3616 HELLO
DEBUG Python Script (Labs) 5:3616 reset
DEBUG Python Script (Labs) 5:3616 clean output ports.
DEBUG Python Script (Labs) 5:3616 Python Script (Labs) 5:3616 has new state: IDLE
DEBUG Python Script (Labs) 5:3616 Configure succeeded. (Python Script (Labs))
DEBUG Python Script (Labs) 5:3616 Python Script (Labs) 5:3616 has new state: CONFIGURED
DEBUG WorkflowEditor Workflow event triggered: WorkflowEvent [type=NODE_SETTINGS_CHANGED;node=5:3616;old=null;new=null;timestamp=1 Oct 2022, 14:23:06]
DEBUG NodeContainerEditPart Python Script (Labs) 5:3616 (CONFIGURED)
DEBUG NodeContainerEditPart Cross Joiner 5:3112 (EXECUTED)
DEBUG CreateConnectionCommand adding connection from 5:3112 1 to 5:3616 1
DEBUG Python Script (Labs) 5:3616 reset
DEBUG Python Script (Labs) 5:3616 clean output ports.
DEBUG NodeContainer Python Script (Labs) 5:3616 has new state: IDLE
DEBUG Python Script (Labs) 5:3616 Configure succeeded. (Python Script (Labs))
DEBUG NodeContainer Python Script (Labs) 5:3616 has new state: CONFIGURED
DEBUG WorkflowManager Added new connection from node 5:3112(1) to node 5:3616(1)
DEBUG WorkflowEditor Workflow event triggered: WorkflowEvent [type=CONNECTION_REMOVED;node=null;old=STD[5:3617(1) → 5:3616( 1)];new=null;timestamp=1 Oct 2022, 14:23:09]
DEBUG WorkflowEditor Workflow event triggered: WorkflowEvent [type=CONNECTION_ADDED;node=null;old=null;new=STD[5:3112(1) → 5:3616( 1)];timestamp=1 Oct 2022, 14:23:09]
DEBUG ConnectionContainerEditPart refreshing visuals for: STD[5:3112(1) → 5:3616( 1)]
DEBUG ConnectionContainerEditPart modelling info: bendpoints:
DEBUG ConnectionContainerEditPart refreshing visuals for: STD[5:3112(1) → 5:3616( 1)]
DEBUG ConnectionContainerEditPart modelling info: bendpoints:
DEBUG NodeContainerEditPart Cross Joiner 5:3112 (EXECUTED)
DEBUG NodeContainerEditPart Python Script (Labs) 5:3616 (CONFIGURED)
DEBUG Buffer Closing input stream on “/private/var/folders/l_/999cl7p931q_x93c3ptlrtxm0000gn/T/knime_container_20221001_14625678616656096097.tmp”, 0 remaining
DEBUG Python Script (Labs) 5:3616 Closing input stream on “/private/var/folders/l_/999cl7p931q_x93c3ptlrtxm0000gn/T/knime_container_20221001_14625678616656096097.tmp”, 0 remaining
DEBUG Python Script (Labs) 5:3616 Closing file /private/var/folders/l_/999cl7p931q_x93c3ptlrtxm0000gn/T/knime_3C_10_R10_Lazad38548/knime_container_20221001_7903022919326639153.knable (4 KB)
DEBUG DefaultPythonGateway Connected to Python process with PID: 24067 after ms: 309

Thanks in advance

Hi Nancyjay,

Sorry to hear about this issue!
Can you send a screenshot of the KNIME > Preferences > Python window and also the KNIME > Preferences > Python (Labs) window?

Also are there error messages when running the regular (non-Labs) Python Script node?

Thanks,
Kyle

Hi Kyle,

thanks for your response. No I don’t get an error with the regular Python Script node.

Here are the two Python pref windows:


Below are screenshots of the Python debug console logged when I drag & drop and connect an upstream node containing data to:

  1. a new Python Script node:

  2. a new Python Script (Labs) node:

Thanks,
Nancy

@Nancyjay could you check the following

1 Like

Have you tried the “older” python nodes? If so do you get the same error?
br

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.