I'm using Tkinter and running into the next error:
Traceback (most recent call last): File "TKtest.py", line 3, in <module> master = tk.Tk() File "/usr/lib/python3.7/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
My code is as simple as it gets:
import tkinter as tk master = tk.Tk()
Note: I am not using SSH. This is just my Pi 4 connected via HDMI to the 7 inch touchscreen. Note2: I already tried to set DISPLAY:0.0 but this doesn't solve the problem: echo $DISPLAY also gives :0.0
How do I solve this error?