Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #62868

Re: Tkinter problem: TclError> couldn't connect to display ":0

References <b6e02836-6f08-4e9f-bd55-201c22ff42b3@googlegroups.com>
Date 2013-12-30 08:40 +1100
Subject Re: Tkinter problem: TclError> couldn't connect to display ":0
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.4707.1388353266.18130.python-list@python.org> (permalink)

Show all headers | View raw


On Mon, Dec 30, 2013 at 7:20 AM, Michael Matveev
<mischamv@googlemail.com> wrote:
> The shell gives out that kind of message:
>
> File "test.py", line 5, in <module>
> root = Tkinter.Tk()
> File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1712, in __init__
> self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
> _tkinter.TclError: couldn't connect to display ":0"

Worked for me on an installed Debian, inside Xfce with xfce4-terminal.

1) What version of Python are you running?
2) Are you running inside some kind of graphical environment?
3) Do you have any sort of permissions/environment change happening? I
get an error like that if I try "sudo python" without any sort of
guard.

ChrisA

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Tkinter problem: TclError> couldn't connect to display ":0 Michael Matveev <mischamv@googlemail.com> - 2013-12-29 12:20 -0800
  Re: Tkinter problem: TclError> couldn't connect to display ":0 Chris Angelico <rosuav@gmail.com> - 2013-12-30 08:40 +1100
  Re: Tkinter problem: TclError> couldn't connect to display ":0 Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-12-30 10:22 +1100
    Re: Tkinter problem: TclError> couldn't connect to display ":0 Chris Angelico <rosuav@gmail.com> - 2013-12-30 10:30 +1100
      Re: Tkinter problem: TclError> couldn't connect to display ":0 Steven D'Aprano <steve@pearwood.info> - 2013-12-30 03:29 +0000
        Re: Tkinter problem: TclError> couldn't connect to display ":0 Chris Angelico <rosuav@gmail.com> - 2013-12-30 15:11 +1100
        Re: Tkinter problem: TclError> couldn't connect to display ":0 Jason Swails <jason.swails@gmail.com> - 2013-12-30 00:59 -0500

csiph-web