❌ Execution failed: Could not connect to the Python process.

:x: Execution failed: Could not connect to the Python process.
i run a workflow in knime, but i can’t, this is my script

import knime.scripting.io as knio

Import required libraries

import pandas as pd

import numpy as np

Read the input data into a pandas DataFrame

data = knio.input_tables[0].to_pandas()

Define the input sequence length and number of future predictions

num_predictions = max(data[‘date_range’].values)

Create a date range

start_date = min(data[‘Min(date_order)’].values)

end_date = max(data[‘Max(date_order)’].values)

date_range = pd.date_range(start_date + pd.DateOffset(0), periods=num_predictions, freq=‘D’)

Create a dataframe with the predicted values and corresponding dates

predicted_data = pd.DataFrame({‘date_knime’: date_range})

Export the predicted data to output.table

knio.output_tables[0] = knio.input_tables[0]

knio.output_tables[1] = knio.Table.from_pandas(predicted_data)

whereas, i have installed, numpy, pandas and also prophet using conda prompt.

Hi @Gelora_Fikrisin ,
If you are using your own Python environment, you may need to check whether the “knime-python-scripting” package has been installed in the current environment.

In the self-installed Python environment, this package needs to be installed additionally.

See the document in detail:
https://docs.knime.com/latest/python_installation_guide/index.html#_configure_the_ap_wide_environment

5 Likes

In addition to the guide I’ve also written an article on medium on this topic (if you know and like the game snake this may also be for you ;-)):

4 Likes

Very detailed operation guide! :+1: :smiley:

1 Like

my knime & phyton have connected. but i can’t run my knime especially the prophet library, whereas i have installed in my anaconda prompt and using environment where i install the prophet library.
anyone can help me?

@Gelora_Fikrisin you should make sure that your Python node does us ethe actual conda environment that has prophecy:

i have followed it and still failed

anyone can help me :smiling_face_with_tear: :smiling_face_with_tear: :smiling_face_with_tear:

i have also tried using miniforge, but there isn’t any change. i have just install prophet, numpy, and pandas

Did you follow the guide to set up a conda env that can be used in KNIME?

E.g. did you:

conda create --name <your-env-name> -c knime -c conda-forge knime-python-scripting=5.2 python=3.11 your-other-packages1 your-other-packages2 ...

If yes, did you select the conda env you are propagating via:

image

Then select your conda env flow variable in this drop down:

image

(or followed what @mlauber71 showed)

1 Like

there is an option only, in my dropdown. is it true?

@Gelora_Fikrisin you will have to make sure the Python node has the environment that has prophecy. Conda environment propagation is one way to do this. More details:

1 Like

agree with mlauber - looks like the conda env you have created is not compatible - I recommend to initially set up your env by following the guide to make sure the right dependencies are installed to make it work in KNIME.

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