tcl_error in Tkinter when launching python IDLE from Cygwin tcl_error in Tkinter when launching python IDLE from Cygwin tkinter tkinter

tcl_error in Tkinter when launching python IDLE from Cygwin


try setting the DISPLAY environment variable

export DISPLAY=:0.0

and make sure you have a cygwin-x server running (i.e Xwin server)

you can add the export to your .bash_rc file so it is set every time you start cygwin.


The answer provided by chaps completely solved my problem. (I'm on Windows 10.) I used the Cygwin installer ("Install from Internet" option) to update my existing Cygwin installation by selecting the "Full" (instead of the default "Pending") option from the dropdown menu at top left of the Cygwin installer, and installing only the packages xorg-server, xinit, xorg-docs, and xlaunch. (I'm not interested in any remote functionality, merely in using tkinter with python3 to do things like display filedialog controls.) I put a shortcut to xlaunch in my Taskbar and launched it with its default settings, then added export DISPLAY=:0.0 to my environment and ran the tkinter test suite. It worked perfectly.