This is an example code:
from tkinter import *
root = Tk()
my_label = Label(root, text="Hello World")
my_laber.pack()
root.mainloop()
that doesn't work on my terminal: Ubuntu (18.04):
Traceback (most recent call last):
File "hello_world.py", line 3, in <module>
root = Tk() #Setting the windown, to do first.
File "/usr/lib/python3.6/tkinter/__init__.py", line 2023, in __init__
self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
_tkinter.TclError: no display name and no $DISPLAY environment variable
How can I fix it?
Python version
Python 3.6.9 (default, Nov 7 2019, 10:44:02)
[GCC 8.3.0] on linux