1

this is my code which I am running on a Python 3 on Repl.it, unfortunately when I try and use the Tkinter module to create a window, it can't seem to find a display environment. Why is this and is there a fix for it?

    import tkinter
    window = tinter.Tk()

And the error is "_tkinter.TclError: no display name and no $DISPLAY environment variable" Thanks in advance for your help

Aran-Fey
  • 39,665
  • 11
  • 104
  • 149
Luke Moran
  • 13
  • 3

1 Answers1

0

Unfortunately, I don't believe you can configure this on repl.it, and if you could, I don't think it would be worth the hassle. Try running your program locally.

Let me try and answer this with an example.

The $DISPLAY environment variable is used to point to any X-server applications you have running on your PC. tkinter will look to your $DISPLAY variable to launch the X-server application (which in turn will launch the X11 protocol used for graphical interfaces).

StarLlama
  • 380
  • 2
  • 12