添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

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,

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:
Screenshot 2022-10-10 at 12.26.20 1856×1438 104 KB Screenshot 2022-10-10 at 12.26.31 1864×1440 87.8 KB

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

a new Python Script node:
Screenshot 2022-10-10 at 12.27.02 1920×380 71.5 KB

a new Python Script (Labs) node:
Screenshot 2022-10-10 at 12.27.25 1920×522 83.1 KB

Thanks,
Nancy

@Nancyjay could you check the following

  • try to use a Cache – KNIME Hub node just before you use the Python node.
  • store your Python environment with a Conda Environment propagation so we could see what your Python is like ( https://www.knime.com/blog/how-to-manage-python-environments-conda-and-knime ) and provide a minimal example
  • provide us with a detailed log on DEBUG level ( Files Corrupted During File Transfer - #8 by mlauber71 )
  • test what happens when you use the (new) Columnar Storage format ( KNIME Columnar Table Backend Boosts Performance | KNIME )
  • see if you have columns other than String and numbers that might require special attention (as of now) in the Python Labs node ( Error with pandas in the Labs Python Integration - #9 by mlauber71 )
  •