python script node throwing error

Python script node throws error when i change default prepackage (Knime preference to conda flow variable) . Error prompt is - An exception occured while running the Python kernel. I have version 5.0 now and face this issue quite frequent. default environment is base while working environment is py3_knime as set name.

See log for details

WARN DefaultPythonGateway Python standard output:
WARN DefaultPythonGateway Python standard error: Traceback (most recent call last):
File “C:\Program Files\KNIME\KNIME 5.0\plugins\org.knime.python3.scripting_5.0.0.v202301191514\src\main\python_kernel_launcher.py”, line 63, in
import knime.scripting._deprecated._table as kt
ModuleNotFoundError: No module named ‘knime.scripting’; ‘knime’ is not a package

WARN DefaultPythonGateway Python standard output:
WARN DefaultPythonGateway Python standard error: Traceback (most recent call last):
File “C:\Program Files\KNIME\KNIME 5.0\plugins\org.knime.python3.scripting_5.0.0.v202301191514\src\main\python_kernel_launcher.py”, line 63, in
import knime.scripting._deprecated._table as kt
ModuleNotFoundError: No module named ‘knime.scripting’; ‘knime’ is not a package

Hi @AnilKS,

Thanks for trying the Python Script node!

I don’t undestand. Are you using a conda environment flow variable via the Conda Propagation node? Or do you use the Python environment built and set via the Preferences?

Can you give as an example workflow?

Did you create a fresh Python environment for that use? Could you please send a screenshot of Preferences -> KNIME -> Python?

What does the script say? (please format code in the forum :slight_smile: )
Screenshot 2023-05-29 at 15.00.12

Thanks in advance
Steffen

1 Like

i am using conda environment flow variable via the Conda Propagation node in python scripting node.
Python environment configuration in preference>knime>python is bundled .unable to find the error as python scripting node works well for basic knime preference while shows kernal error when using conda flow variable.

WARN DefaultPythonGateway Python standard output:
WARN DefaultPythonGateway Python standard error: Traceback (most recent call last):
File “C:\Program Files\KNIME\KNIME 5.0\plugins\org.knime.python3.scripting_5.0.0.v202301191514\src\main\python_kernel_launcher.py”, line 63, in
import knime.scripting._deprecated._table as kt
WARN DefaultPythonGateway .txt (1.6 KB)

ModuleNotFoundError: No module named ‘knime.scripting’; ‘knime’ is not a package

Hi,

you probably have the package knime installed via pip in the environment used for the Python script node. This currently does not work due to a name clash. You can remove knime in the respective Python environment by executing the command pip uninstall knime in your terminal.

Does that help?

Steffen

5 Likes

this is showing two packages
…\envs\py3_knime\lib\site-packages\knime-0.11.6.dist-info*
…\envs\py3_knime\lib\site-packages\knime.py
it will remove both …

anil

1 Like

Please go ahead and tell me what the result is

1 Like

its not showing any kernel error now … i have uninstalled both. Started working.

Thanks
Anil

1 Like

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