Python views issues (Portal, colors and legend)


I have a few challenges with my python view note.

It was recommended to me and really worked well for that problem (Double y-axis). So thank you community :slight_smile:

I have encountered additional challenges since then.

First, I get an error message, when I try to run my workflow on the portal. It runs fine in desktop KNIME.
It says “No display name”. The full length of the error can be read in the end of this post.

Second, I can’t figure out how to make dynamic colors and include legends to the python view. Right now I can only make each input type one color (atm. red and blue - with no legends)
I have unsuccessfully followed these guides:

I have attached shots of my workflow (so what comes after my python view, that is inside the line plot component) and the script in my python view.

Hope some of the more experienced members of this community can help.
If I have supplied too few information’s, please let med know. Then I’ll try to supply the correct ones.

Best regard

Full length error:
Execute failed: no display name and no $DISPLAY environment variable Traceback (most recent call last): File "<string>", line 9, in <module> File "/usr/lib/python3/dist-packages/pandas/plotting/", line 2677, in call sort_columns=sort_columns, **kwds) File "/usr/lib/python3/dist-packages/pandas/plotting/", line 1902, in plot_frame **kwds) File "/usr/lib/python3/dist-packages/pandas/plotting/", line 1729, in _plot plot_obj.generate() File "/usr/lib/python3/dist-packages/pandas/plotting/", line 251, in generate self._setup_subplots() File "/usr/lib/python3/dist-packages/pandas/plotting/", line 302, in _setup_subplots fig = self.plt.figure(figsize=self.figsize) File "/usr/lib/python3/dist-packages/matplotlib/", line 539, in figure **kwargs) File "/usr/lib/python3/dist-packages/matplotlib/", line 171, in new_figure_manager return cls.new_figure_manager_given_figure(num, fig) File "/usr/lib/python3/dist-packages/matplotlib/backends/", line 1049, in new_figure_manager_given_figure window = Tk.Tk(className="matplotlib") File "/usr/lib/python3.6/tkinter/", line 2023, in init = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use) _tkinter.TclError: no display name and no $DISPLAY environment variable

1 Like

It would be helpful if you could provide us with a ‘working’ (or not working that is) example where the error shows up. Then we could try to solve the problem an tur your exampel into a working one - then you could adapt it.

With screenshots and parts of Logs it is not so eays to judge what is going on.

Hi mlauber71

Thank you for reaching out.

I’m a bit constrained by my company’s NDA.

My workflow is looking into our database, and if I replace the data import with some generic data the entire workflow fucks up. I just tried - and failed.

It will be difficult for me to show you the real problem without violating my loyalty to my company.
Is there any other way I can provide the needed information’s?

Again, thank you very much for helping. Much appreciated.

Best regards

Hi again

I can tell, that the web portal runs on a Linux server.
And I think, the error might have something to do, with the python view node trying to display the image on the server for interactivity, instead of just transferring to report and table, as I usually do. The server doesn’t have a program for displaying images.

Best regards

Of course I understand that you cannot send confidential informations. So it would make sense to try it with a generic/public data set. In this way we could be sure it is a general problem and not related to your specific data.

The tricky part with KNIME and Python is to get the results out to reuse them. Once the graphic is back in KNIME it should be possible to use the standard nodes.

Linux might add another aspect to the provlem. My experience is focussed on Windows and McOS.

Hi mlauber71

I’ll look into your solutions. Thank you for providing those.

Yes, it is troublesome with the confidentiality. If this all fails I will have to re write a workflow, that shows my problem. Though I hope it can be solved easier.

If anybody else have some suggestions, they will still be very much appreciated.

Best regards

Hi there @BjarkePetersen,

if you are talking about Portal as WebPortal that comes with KNIME Server product change Category into KNIME Server to get more attention.


Hi ipazin

I do mean WebPortal.

But the other problems (color + legends) is still there.
Those this problem is a bit more fundamental.

I will change the category.



Thus far I am not permitted to change the category into server.
And now the edit function seems to have disappeared, when I try to change it into something else.

I guess it must be very visible by now, that I am a beginner in this game :slight_smile:


Hi @BjarkePetersen,

if I got you right you said it works in KNIME Desktop and not on Portal so I would say it is KNIME Server category. Additional things like color and legend that are general if won’t get covered by this topic you can open a new one.

I have changed category.


1 Like

Just to make sure. Can you try a simple example on the server? And make sure you have the necessary extensions installed.

Then we would get an idea if it is a general problem with python or specific for your packages and code.

By default the executor on the server is running headless, i.e. without any UI interaction. This message

indicates that your Python code requires UI access. It’s usually sufficient to provide a virtual X server to such processes via Xvfb and set the DISPLAY environment variable accordingly.


Hi Thor

Thank you for your involvement.
It helped me in the right direction.

I found this page, that solves the problem:

I simply added these lines before importing matplotlib.pyplot:
“import matplotlib as mpl

I now have another issue about maximum length of cell contents. But that’s a different story.

So again, thank you very much for giving a push in the right direction :slight_smile:

Best regards


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