The error _tkinter.TclError: couldn’t connect to display “:0” or
literally means it tried to find a display (set by the WAYLAND_DISPLAY
or DISPLAY
variables, run printenv
inside your container application to make sure those are set) but it wasn’t able to.
It either means that:
-
you’re not running a display server: make sure that you’re running a Weston container (pysimplegui/docker-compose.yaml at main · leonheldattoradex/pysimplegui · GitHub).
-
or you’re not properly connecting the display server to your application: make sure you’re sharing the
tmp
folder that contains the Wayland socket (pysimplegui/docker-compose.yaml at main · leonheldattoradex/pysimplegui · GitHub, pysimplegui/docker-compose.yaml at main · leonheldattoradex/pysimplegui · GitHub) before running your Tkinter container.
Please check this thread, there’s a lot of information there about this specific error message: Containers not running in TorizonCore with evaluation containers for iMX8M-Plus - #22 by SCordibella
I also tried your sample here … I don’t know how to apply it
You need to copy it over to Torizon OS and run it with docker-compose up
.
I read somewhere that Torizon OS does not support Xserver, which tkinter needs. Is that true?
It does through XWayland (a Xserver under Wayland), so it shouldn’t have problems there.