Problem with python/tkinter: _tkinter.TclError: couldn’t connect to display “0.0”

Hi, I’m new to Fedora and I’m trying to learn Python with tkinter, but I keep receiving an error about unable to connect to Display.
Does anybody know how to solve this?

I used the virtual environment and run the “export DISPLAY=0.0” command in the terminal which I found in some troubleshooting forums on the web, but still have this error message:

_tkinter.TclError: couldn’t connect to display “0.0”

Please avoid reviving very old topics, and since you have a new problem, it is generally the best idea to open a new topic about it :classic_smiley:

I already did it for you this time: with a dedicated topic, you have best chances to get your issue solved.

By the way, welcome to the community :classic_smiley:

1 Like

This should not be required as DISPLAY will already be set by your desktop environment.

Also the format you are using is wrong, it would be export DISPLAY=:0.
But as I say it should already be set.

1 Like