[Pythonmac-SIG] TKinter problem

Toby Donaldson tjd at sfu.ca
Wed Oct 26 07:14:47 CEST 2005


Hi,

I'm running Python 2.4.1 on Mac OS X 10.4, and whenever I run a
Tkinter command I get a "no display name and no $DISPLAY environment
variable" error, e.g.

>>> import Tkinter
>>> Tkinter.Toplevel()
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/lib-tk/Tkinter.py",
line 1912, in __init__
    BaseWidget.__init__(self, master, 'toplevel', cnf, {}, extra)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/lib-tk/Tkinter.py",
line 1862, in __init__
    BaseWidget._setup(self, master, cnf)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/lib-tk/Tkinter.py",
line 1837, in _setup
    _default_root = Tk()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/lib-tk/Tkinter.py",
line 1569, in __init__
    self.tk = _tkinter.create(screenName, baseName, className,
interactive, wantobjects, useTk, sync, use)
_tkinter.TclError: no display name and no $DISPLAY environment variable

Any advice?

Toby
--
Dr. Toby Donaldson
School of Computing Science
Simon Fraser University (Surrey)


More information about the Pythonmac-SIG mailing list