Python View output image port error, with Plotly package

Hello knimers,
I am testing to work with Plotly charts in KNIME, and I am finding hurdles that may be related to my Py configuration…

I am currently running KNIME 4.7.0 ; and Py environment is set as follow:

note: I’ve just restarted with a new py3_knime env triggered from ‘New environment’ button, but resulting into the same problem.

Said that, I am playing around with the following code in a Python View node. This part of the code is running ok; so the ‘Interactive view output’ displays nice:

# Import modules and functions
import as knio
import as px
from plotly.offline import plot
import as pio

# Creating a Plotly Scatterplot
df =
chart = px.scatter(data_frame=df, x='sepal_width', y='sepal_length', color='species', title='data.iris()')

# Assign chart to output_view variable
knio.output_view = knio.view(chart)

Now, when I add the ‘Output image port’ and aggregate the following code; the node doesn’t return any error message to console , but keeps running forever until I cancel it…

# Update image dimensions for output port
knio.output_images[0] = pio.to_image(chart, format="png")


I’ve tested to connect ‘Conda Environment Propagation’ node with no success.

I’ve tested some sample workflows from Hub like this amazing work from @DiaAzul but I am having the very same problem.

Any tips are welcome. Thank you in advance.


Thanks for adding me in the post. I have stopped using the forum since the change, and would not know that you had raised a question.

You need to check you conda environment to ensure that you are consistent with the base packages required by KNIME. Note, in KNIIME 4.7 the Python version is 3.9, whereas, your conda environment is 3.8.

In addition to the standard Python environment you will also need to add a package to convert the html output from Plotly into an image file format. This package is Kaleido. Whilst Kaleido is a very popular package for producing image files from Plotly charts the maintainer has stepped away from the project following a change of job (about two years ago). The package is no longer actively maintained and may break at any point in time. It is a warning to all who rely upon it.

The conda command to install Kaleido is not obvious :
conda install -c conda-forge python-kaleido

Hope that helps
LinkedIn | Medium | GitHub


Hello @DiaAzul
Thank you for your answer. I had installed kaleido; as I read that it is taken this package by default, but I don’t remember installing it with the mentioned command. Thanks as well for the warning about maintenance discontinuity. Break of the code for this reason would be sad.

I will also install conda back again, with updated Py version. I overrode the QC on base packages assuming they are all included, when creating the environment from KNIME button instead from cmd Anaconda terminal. I’ll dive into as well.

kaleido was installed from Anaconda terminal with ‘pip install kaleido’
‘plotly’ aren’t included in base packages either

I will keep you updated on the progress.


1 Like

Hello @DiaAzul

I 've finally found the right moment to reinstall all my Conda and Py environment. You were right; thanks for the support.



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