-1

I am new to python. I was trying to execute a simple py file to draw up simple gui application. However I got following exception.

_tkinter.TclError: no display name and no $DISPLAY environment variable

I was accessing remote workstation (redhat OS with python 2.6.6 installed) via VMWare vSphere Client. Is there any configuration option I could have set to successfully launch the application?

Contents of py file:

#!/usr/bin/python
import Tkinter
top = Tkinter.Tk()
top.mainloop()
DaeYoung
  • 1,161
  • 6
  • 27
  • 59

1 Answers1

0

I suspect your problem is not with the python program itself, but with your environment from which you launch the program.

Try to execute a simple 'xterm' instead of your program, if it also complains about DISPLAY it confirms my suspicion. There are multiple possible ways to address the issue if confirmed, including on StackOverflow, just google 'setting DISPLAY'.

Dan Cornilescu
  • 39,470
  • 12
  • 57
  • 97