freely
Posts: 2
Joined: Mon Mar 04, 2013 10:37 am

Tkinter display error

Mon Aug 12, 2013 1:11 am

Hi

I am experimenting with Tkinter and wanted to try it on the pi - but when I try the acid test - window=Tkinter.Tk() - I get the error:
_tkinter.TclError: no display name and no $DISPLAY environment variable

I saw another post on a similar issue on this board but it was well down the thread and wasn't resolved - so I hoped to push it back up the list a bit (!) and see if anyone can help me figure out what's going wrong.

I'm running Python 2.7 from the command line (sudo python). startx runs normally if I try to use the GUI.

any suggestions gratefully received!

freely

dr_d_gee
Posts: 84
Joined: Fri Jan 04, 2013 1:30 pm

Re: Tkinter display error

Tue Aug 13, 2013 1:39 pm

A Tkinter program will need the GUI to run. Have you tried running it under X?

freely
Posts: 2
Joined: Mon Mar 04, 2013 10:37 am

Re: Tkinter display error

Thu Aug 15, 2013 2:24 am

Hi - ah! I didn't realise this. So I have to run a GUI in order to create a Tkinter GUI? Is that always true for Linux?

Sorry to be so ignorant! I have been experimenting from a Windows command prompt - but I use the pi without a mouse so haven't even explored X except to make sure it ran. Having started X, can I get to a terminal window without the mouse?

Thanks again!

Freely

Return to “Python”