Python node is warning "Error while sending a command."

Helllo Knime team members:
I’ve set python enviroment configuraion at “conda” and installed python3 conda enviroment and openpyxl.
but when I am running lines in python scirpt node, the node is warnning Error while sending a command.
Strangely after I switched to original python enviroment “Bundle”, everything is OK.
please advise how I can use openpyxl well under the conda enviroment.




Thanks in advance

Hi @wooddenbowl,

could you please send us the log?
Which KNIME Analytics version did you use? Could you send a dump of the used environment please?

Thanks in advance!
Steffen

1 Like

Hi Steffen
Sorry for late reply. My version is 4.7.2. Please look at the below images of the log.


Hi @wooddenbowl,
Somehow the communication between the Java process and the Python process (via py4j) does not work. Can you please post a list of the packages installed in the Conda environment? (conda list -n <env_name>)

Does the script work when executed in the console directly?

1 Like

Hi bwilhelm
The attachment is what I’ve installed in Py3 _conda_enviroment.
By the way, I’ve runned my python script both inside the node and the console
conda_list.txt (24.6 KB)

Hi @wooddenbowl,
The file that you sent shows the content of the “base” environment. I guess this is not the environment that you are using, right? Did the script work when you executed it in the console?

Hello bwilhelm
please find the attachment of my py3_knime package list. The script fails with openpyxl and the console is warning.
py3_knime.txt (13.0 KB)

The list of packages looks fine. Everything necessary is included.

Can you elaborate? What happens if you copy the code into a Python script file (without the first and last line but maybe add a print(df) to see the output) and execute it in the “py3_knime” environment with python path_to_the_script.py?

pleas find the attached docs.
conda_py3_knime.docx (244.4 KB)

Hi @wooddenbowl,
This we already established that the script does not work in the “Python Script” node with your “py3_knime” environment. I am asking you to verify that the Conda environment contains a working Python installation (that is able to run the script) without the use of KNIME (just to find where the issue happens).

1 Like

Hi
Please look at the following image

@wooddenbowl you might want to check this article about how to set up a conda environment and connect it to KNIME. It might be best to start from scratch.

1 Like

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