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 knime.scripting.io as knio
import plotly.express as px
from plotly.offline import plot
import plotly.io as pio
# Creating a Plotly Scatterplot
df = px.data.iris()
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.
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
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.