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

**URL:** <https://forum.knime.com/t/python-script-labs-error-an-exception-occured-while-running-the-python-kernel-see-log-for-details/47759>\
**Category:** KNIME Analytics Platform\
**Tags:** labs, python\
**Created:** [October 1, 2022, 1:33pm UTC](https://forum.knime.com/t/python-script-labs-error-an-exception-occured-while-running-the-python-kernel-see-log-for-details/47759 "2022-10-01T13:33:00Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nancyjay](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/n/c89c15/32.png) [@Nancyjay](https://forum.knime.com/u/Nancyjay)\
**Post date:** [October 1, 2022, 1:33pm UTC](https://forum.knime.com/t/python-script-labs-error-an-exception-occured-while-running-the-python-kernel-see-log-for-details/47759/1 "2022-10-01T13:33:00Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Kyle\_Watkins](https://forum-cdn.knime.com/user_avatar/forum.knime.com/kyle_watkins/32/42960_2.png) [@Kyle\_Watkins](https://forum.knime.com/u/Kyle_Watkins)\
**Post date:** [October 5, 2022, 9:48pm UTC](https://forum.knime.com/t/python-script-labs-error-an-exception-occured-while-running-the-python-kernel-see-log-for-details/47759/2 "2022-10-05T21:48:01Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Nancyjay](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/n/c89c15/32.png) [@Nancyjay](https://forum.knime.com/u/Nancyjay)\
**Post date:** [October 10, 2022, 11:31am UTC](https://forum.knime.com/t/python-script-labs-error-an-exception-occured-while-running-the-python-kernel-see-log-for-details/47759/3 "2022-10-10T11:31:22Z")

</div>

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](https://forum-cdn.knime.com/uploads/default/original/3X/0/b/0bc77260e13b344fe9cd938eb41c2d643196910d.jpeg)  
 ![Screenshot 2022-10-10 at 12.26.31](https://forum-cdn.knime.com/uploads/default/original/3X/1/0/108dbb74e1655443869c773990e2a89b9ba1a06e.jpeg)

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

---

<div class="post-metadata">

**Author:** ![mlauber71](https://forum-cdn.knime.com/user_avatar/forum.knime.com/mlauber71/32/73590_2.png) [@mlauber71](https://forum.knime.com/u/mlauber71)\
**Post date:** [October 10, 2022, 11:47am UTC](https://forum.knime.com/t/python-script-labs-error-an-exception-occured-while-running-the-python-kernel-see-log-for-details/47759/4 "2022-10-10T11:47:43Z")

</div>

@Nancyjay could you check the following

- try to use a [Cache – KNIME Hub](https://kni.me/n/Qi07PtWEA5wwcXn5) 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](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](https://forum.knime.com/t/files-corrupted-during-file-transfer/43738/8))
- test what happens when you use the (new) Columnar Storage format ([KNIME Columnar Table Backend Boosts Performance | KNIME](https://www.knime.com/blog/improved-performance-with-new-table-backend))
- 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](https://forum.knime.com/t/error-with-pandas-in-the-labs-python-integration/44473/9))

---

<div class="post-metadata">

**Author:** ![Daniel\_Weikert](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/d/e47c2d/32.png) [@Daniel\_Weikert](https://forum.knime.com/u/Daniel_Weikert)\
**Post date:** [October 10, 2022, 5:36pm UTC](https://forum.knime.com/t/python-script-labs-error-an-exception-occured-while-running-the-python-kernel-see-log-for-details/47759/5 "2022-10-10T17:36:47Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://forum-cdn.knime.com/uploads/default/original/1X/ab3ccf34482a0329361734a18199390177204f15.png) [@system](https://forum.knime.com/u/system)\
**Post date:** [January 8, 2023, 5:37pm UTC](https://forum.knime.com/t/python-script-labs-error-an-exception-occured-while-running-the-python-kernel-see-log-for-details/47759/6 "2023-01-08T17:37:07Z")

</div>

Closed on January 8, 2023, 5:37pm UTC

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