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


Groups > comp.lang.python > #98663 > unrolled thread

More tkinter Madness

Started byTim Daneliuk <tundraBOGUS@tundraware.com>
First post2015-11-11 19:52 -0600
Last post2015-11-14 09:14 +0100
Articles 16 — 6 participants

Back to article view | Back to comp.lang.python


Contents

  More tkinter Madness Tim Daneliuk <tundraBOGUS@tundraware.com> - 2015-11-11 19:52 -0600
    Re: More tkinter Madness Paul Rubin <no.email@nospam.invalid> - 2015-11-11 18:12 -0800
      Re: More tkinter Madness Tim Daneliuk <tundraBOGUS@tundraware.com> - 2015-11-12 18:26 -0600
    Re: More tkinter Madness Chris Angelico <rosuav@gmail.com> - 2015-11-12 13:25 +1100
      Re: More tkinter Madness Tim Daneliuk <tundraBOGUS@tundraware.com> - 2015-11-12 18:25 -0600
        Re: More tkinter Madness Michael Torrie <torriem@gmail.com> - 2015-11-12 21:46 -0700
          Re: More tkinter Madness Tim Daneliuk <tundraBOGUS@tundraware.com> - 2015-11-12 23:42 -0600
            Re: More tkinter Madness Christian Gollwitzer <auriocus@gmx.de> - 2015-11-13 07:32 +0100
              Re: More tkinter Madness Tim Daneliuk <tundraBOGUS@tundraware.com> - 2015-11-13 13:14 -0600
                Re: More tkinter Madness Laura Creighton <lac@openend.se> - 2015-11-13 20:56 +0100
                  Re: More tkinter Madness Tim Daneliuk <tundraBOGUS@tundraware.com> - 2015-11-13 16:10 -0600
                Re: More tkinter Madness Michael Torrie <torriem@gmail.com> - 2015-11-13 12:58 -0700
                  Re: More tkinter Madness Tim Daneliuk <tundraBOGUS@tundraware.com> - 2015-11-13 16:09 -0600
                Re: More tkinter Madness Christian Gollwitzer <auriocus@gmx.de> - 2015-11-13 22:30 +0100
                  Re: More tkinter Madness Tim Daneliuk <tundraBOGUS@tundraware.com> - 2015-11-13 16:10 -0600
                    Re: More tkinter Madness Christian Gollwitzer <auriocus@gmx.de> - 2015-11-14 09:14 +0100

#98663 — More tkinter Madness

FromTim Daneliuk <tundraBOGUS@tundraware.com>
Date2015-11-11 19:52 -0600
SubjectMore tkinter Madness
Message-ID<708dhc-3pf1.ln1@oceanview.tundraware.com>
I am the author of twander (https://www.tundraware.com/Software/twander).
This code has run flawlessly for years on FreeBSD, Linux, MacOS and
Windows.  Some months ago, I put it on a couple of VPS servers (FreeBSD
and Linux) and BOOM, it doesn't run.  I asked around here and got some
suggestions and then did some homework.

I see the error being thrown by using the trace module, but it's not 
terribly meaningful to me.  Any ideas of what this means - again,
I emphasize this is only happening on VPS hosts:

 --- modulename: Tkinter, funcname: _cnfmerge
Tkinter.py(76):     if type(cnfs) is DictionaryType:
Tkinter.py(77):         return cnfs
Tkinter.py(1046):         res = ()
Tkinter.py(1047):         for k, v in cnf.items():
Tkinter.py(1048):             if v is not None:
Tkinter.py(1049):                 if k[-1] == '_': k = k[:-1]
Tkinter.py(1050):                 if callable(v):
Tkinter.py(1052):                 elif isinstance(v, (tuple, list)):
Tkinter.py(1064):                 res = res + ('-'+k, v)
Tkinter.py(1047):         for k, v in cnf.items():
Tkinter.py(1048):             if v is not None:
Tkinter.py(1049):                 if k[-1] == '_': k = k[:-1]
Tkinter.py(1050):                 if callable(v):
Tkinter.py(1052):                 elif isinstance(v, (tuple, list)):
Tkinter.py(1064):                 res = res + ('-'+k, v)
Tkinter.py(1047):         for k, v in cnf.items():
Tkinter.py(1048):             if v is not None:
Tkinter.py(1049):                 if k[-1] == '_': k = k[:-1]
Tkinter.py(1050):                 if callable(v):
Tkinter.py(1052):                 elif isinstance(v, (tuple, list)):
Tkinter.py(1064):                 res = res + ('-'+k, v)
Tkinter.py(1047):         for k, v in cnf.items():
Tkinter.py(1065):         return res
Traceback (most recent call last):
  File "/usr/lib64/python2.6/runpy.py", line 122, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib64/python2.6/runpy.py", line 34, in _run_code
    exec code in run_globals
  File "/usr/lib64/python2.6/trace.py", line 823, in <module>
    main()
  File "/usr/lib64/python2.6/trace.py", line 811, in main
    t.runctx(code, globs, globs)
  File "/usr/lib64/python2.6/trace.py", line 512, in runctx
    exec cmd in globals, locals
  File "/local/TundraWare/bin/twander.py", line 5464, in <module>
    UI = twanderUI(UIroot)
  File "/local/TundraWare/bin/twander.py", line 2152, in __init__
    self.CmdBtn = Menubutton(self.mBar, text=COMMANDMENU, underline=0, state=DISABLED)
  File "/usr/lib64/python2.6/lib-tk/Tkinter.py", line 2710, in __init__
    Widget.__init__(self, master, 'menubutton', cnf, kw)
  File "/usr/lib64/python2.6/lib-tk/Tkinter.py", line 1932, in __init__
    (widgetName, self._w) + extra + self._options(cnf))
_tkinter.TclError

[toc] | [next] | [standalone]


#98664

FromPaul Rubin <no.email@nospam.invalid>
Date2015-11-11 18:12 -0800
Message-ID<87oaf0q82t.fsf@nightsong.com>
In reply to#98663
Tim Daneliuk <tundraBOGUS@tundraware.com> writes:
> Some months ago, I put it on a couple of VPS servers (FreeBSD
> and Linux) and BOOM, it doesn't run.  I asked around here and got some
> suggestions and then did some homework.

I'd expect a VPS server to have no display--is it an X client forward to
your workstation?  Are all the proper X libraries installed?  Note that
X port forwarding over the internet is generally unusable even if your
internet connection is pretty fast.  It's kind of ok over a LAN.

[toc] | [prev] | [next] | [standalone]


#98724

FromTim Daneliuk <tundraBOGUS@tundraware.com>
Date2015-11-12 18:26 -0600
Message-ID<2bnfhc-epd2.ln1@oceanview.tundraware.com>
In reply to#98664
On 11/11/2015 08:12 PM, Paul Rubin wrote:
> Tim Daneliuk <tundraBOGUS@tundraware.com> writes:
>> Some months ago, I put it on a couple of VPS servers (FreeBSD
>> and Linux) and BOOM, it doesn't run.  I asked around here and got some
>> suggestions and then did some homework.
> 
> I'd expect a VPS server to have no display--is it an X client forward to
> your workstation?  Are all the proper X libraries installed?  Note that
> X port forwarding over the internet is generally unusable even if your
> internet connection is pretty fast.  It's kind of ok over a LAN.
> 

twander is a very, very ligthweight file browser with minimal GUI load.
It's always worked well even with X forwarded over an ssh session over the
open internet.

I will further investigate the X libs matter.

[toc] | [prev] | [next] | [standalone]


#98665

FromChris Angelico <rosuav@gmail.com>
Date2015-11-12 13:25 +1100
Message-ID<mailman.252.1447295160.16136.python-list@python.org>
In reply to#98663
On Thu, Nov 12, 2015 at 12:52 PM, Tim Daneliuk
<tundraBOGUS@tundraware.com> wrote:
> I am the author of twander (https://www.tundraware.com/Software/twander).
> This code has run flawlessly for years on FreeBSD, Linux, MacOS and
> Windows.  Some months ago, I put it on a couple of VPS servers (FreeBSD
> and Linux) and BOOM, it doesn't run.  I asked around here and got some
> suggestions and then did some homework.
>
> Traceback (most recent call last):
>   File "/usr/lib64/python2.6/runpy.py", line 122, in _run_module_as_main

It's running here under Python 2.6. Sorry if this is a question you've
already been asked, but were you successfully running under 2.6
elsewhere? Might be a versioning issue.

ChrisA

[toc] | [prev] | [next] | [standalone]


#98723

FromTim Daneliuk <tundraBOGUS@tundraware.com>
Date2015-11-12 18:25 -0600
Message-ID<v8nfhc-epd2.ln1@oceanview.tundraware.com>
In reply to#98665
On 11/11/2015 08:25 PM, Chris Angelico wrote:
> On Thu, Nov 12, 2015 at 12:52 PM, Tim Daneliuk
> <tundraBOGUS@tundraware.com> wrote:
>> I am the author of twander (https://www.tundraware.com/Software/twander).
>> This code has run flawlessly for years on FreeBSD, Linux, MacOS and
>> Windows.  Some months ago, I put it on a couple of VPS servers (FreeBSD
>> and Linux) and BOOM, it doesn't run.  I asked around here and got some
>> suggestions and then did some homework.
>>
>> Traceback (most recent call last):
>>   File "/usr/lib64/python2.6/runpy.py", line 122, in _run_module_as_main
> 
> It's running here under Python 2.6. Sorry if this is a question you've
> already been asked, but were you successfully running under 2.6
> elsewhere? Might be a versioning issue.
> 
> ChrisA
> 

It always ran OK on every previous version of Python from about 2.4 forward
on VMs, physicals, *nix, OSX, Windows, etc.

[toc] | [prev] | [next] | [standalone]


#98727

FromMichael Torrie <torriem@gmail.com>
Date2015-11-12 21:46 -0700
Message-ID<mailman.283.1447389990.16136.python-list@python.org>
In reply to#98723
On 11/12/2015 05:25 PM, Tim Daneliuk wrote:
> On 11/11/2015 08:25 PM, Chris Angelico wrote:
>> On Thu, Nov 12, 2015 at 12:52 PM, Tim Daneliuk
>> <tundraBOGUS@tundraware.com> wrote:
>>> I am the author of twander (https://www.tundraware.com/Software/twander).
>>> This code has run flawlessly for years on FreeBSD, Linux, MacOS and
>>> Windows.  Some months ago, I put it on a couple of VPS servers (FreeBSD
>>> and Linux) and BOOM, it doesn't run.  I asked around here and got some
>>> suggestions and then did some homework.
>>>
>>> Traceback (most recent call last):
>>>   File "/usr/lib64/python2.6/runpy.py", line 122, in _run_module_as_main
>>
>> It's running here under Python 2.6. Sorry if this is a question you've
>> already been asked, but were you successfully running under 2.6
>> elsewhere? Might be a versioning issue.
>>
>> ChrisA
>>
> 
> It always ran OK on every previous version of Python from about 2.4 forward
> on VMs, physicals, *nix, OSX, Windows, etc.

And other X11 apps are working fine on the test VPS where your app
crashes? Other Tk apps?  Other Python Tk apps?

Your app runs fine on my VPS (Linode), running CentOS 7, Python 2.7.
Also runs fine on my CentOS 6 VM (also Linode), Python 2.6.6.

I also verified that if X11 forwarding is not working, Python reports an
exception "_tkinter.TclError: no display name and no $DISPLAY
environment variable" immediately, so that's definitely not your problem.


[toc] | [prev] | [next] | [standalone]


#98729

FromTim Daneliuk <tundraBOGUS@tundraware.com>
Date2015-11-12 23:42 -0600
Message-ID<fr9ghc-c5i2.ln1@oceanview.tundraware.com>
In reply to#98727
On 11/12/2015 10:46 PM, Michael Torrie wrote:
> On 11/12/2015 05:25 PM, Tim Daneliuk wrote:
>> On 11/11/2015 08:25 PM, Chris Angelico wrote:
>>> On Thu, Nov 12, 2015 at 12:52 PM, Tim Daneliuk
>>> <tundraBOGUS@tundraware.com> wrote:
>>>> I am the author of twander (https://www.tundraware.com/Software/twander).
>>>> This code has run flawlessly for years on FreeBSD, Linux, MacOS and
>>>> Windows.  Some months ago, I put it on a couple of VPS servers (FreeBSD
>>>> and Linux) and BOOM, it doesn't run.  I asked around here and got some
>>>> suggestions and then did some homework.
>>>>
>>>> Traceback (most recent call last):
>>>>   File "/usr/lib64/python2.6/runpy.py", line 122, in _run_module_as_main
>>>
>>> It's running here under Python 2.6. Sorry if this is a question you've
>>> already been asked, but were you successfully running under 2.6
>>> elsewhere? Might be a versioning issue.
>>>
>>> ChrisA
>>>
>>
>> It always ran OK on every previous version of Python from about 2.4 forward
>> on VMs, physicals, *nix, OSX, Windows, etc.
> 
> And other X11 apps are working fine on the test VPS where your app
> crashes? Other Tk apps?  Other Python Tk apps?
> 
> Your app runs fine on my VPS (Linode), running CentOS 7, Python 2.7.
> Also runs fine on my CentOS 6 VM (also Linode), Python 2.6.6.
> 
> I also verified that if X11 forwarding is not working, Python reports an
> exception "_tkinter.TclError: no display name and no $DISPLAY
> environment variable" immediately, so that's definitely not your problem.
> 
> 
> 

Curioser and curioser.  Yes, xterm works fine.  Dunno about any other tk apps.
Hmmmm..

[toc] | [prev] | [next] | [standalone]


#98730

FromChristian Gollwitzer <auriocus@gmx.de>
Date2015-11-13 07:32 +0100
Message-ID<n2400v$h96$1@dont-email.me>
In reply to#98729
Am 13.11.15 um 06:42 schrieb Tim Daneliuk:
>
> Curioser and curioser.  Yes, xterm works fine.  Dunno about any other tk apps.

Hello world Tk is like this:

Apfelkiste:Sources chris$ wish
% pack [button .b -text Hello -command exit]
% Apfelkiste:Sources chris$

Upon starting wish, an empty window should appear. The single line makes 
a button, which exits the program when pressed.

It is very strange in your Traceback, that the TclError is not 
accompanyied by an actual error. This indicates that something more 
fundamental is going wrong. It seems to crash upon "import tkinter"; can 
you try reinstalling all related packages?

	Christian

[toc] | [prev] | [next] | [standalone]


#98756

FromTim Daneliuk <tundraBOGUS@tundraware.com>
Date2015-11-13 13:14 -0600
Message-ID<0dphhc-ntf.ln1@oceanview.tundraware.com>
In reply to#98730
On 11/13/2015 12:32 AM, Christian Gollwitzer wrote:
> Apfelkiste:Sources chris$

Well, I get window and when I do this:

pack [button .b -text Hello -command exit]

Nothing appears.

tkinter appears borked

I have reinstalled once already, will try again

[toc] | [prev] | [next] | [standalone]


#98761

FromLaura Creighton <lac@openend.se>
Date2015-11-13 20:56 +0100
Message-ID<mailman.301.1447444567.16136.python-list@python.org>
In reply to#98756
In a message of Fri, 13 Nov 2015 13:14:08 -0600, Tim Daneliuk writes:
>On 11/13/2015 12:32 AM, Christian Gollwitzer wrote:
>> Apfelkiste:Sources chris$
>
>Well, I get window and when I do this:
>
>pack [button .b -text Hello -command exit]
>
>Nothing appears.
>
>tkinter appears borked
>
>I have reinstalled once already, will try again

Next idea.

Try to run a basic Tk app and a basic Tcl one.  See if they work or not.

Laura

[toc] | [prev] | [next] | [standalone]


#98775

FromTim Daneliuk <tundraBOGUS@tundraware.com>
Date2015-11-13 16:10 -0600
Message-ID<56465FC0.9040608@tundraware.com>
In reply to#98761
On 11/13/2015 01:56 PM, Laura Creighton wrote:
> In a message of Fri, 13 Nov 2015 13:14:08 -0600, Tim Daneliuk writes:
>> On 11/13/2015 12:32 AM, Christian Gollwitzer wrote:
>>> Apfelkiste:Sources chris$
>>
>> Well, I get window and when I do this:
>>
>> pack [button .b -text Hello -command exit]
>>
>> Nothing appears.
>>
>> tkinter appears borked
>>
>> I have reinstalled once already, will try again
> 
> Next idea.
> 
> Try to run a basic Tk app and a basic Tcl one.  See if they work or not.
> 
> Laura
> 

Looks like tcl/tk is hosed for some reason.

[toc] | [prev] | [next] | [standalone]


#98762

FromMichael Torrie <torriem@gmail.com>
Date2015-11-13 12:58 -0700
Message-ID<mailman.302.1447444684.16136.python-list@python.org>
In reply to#98756
On 11/13/2015 12:14 PM, Tim Daneliuk wrote:
> On 11/13/2015 12:32 AM, Christian Gollwitzer wrote:
>> Apfelkiste:Sources chris$
> 
> Well, I get window and when I do this:
> 
> pack [button .b -text Hello -command exit]
> 
> Nothing appears.
> 
> tkinter appears borked
> 
> I have reinstalled once already, will try again

Tkinter is the name of the Python package for using Tk, but Tk itself is
usually called Tk (package on Fedora and RHEL is tk).

On my CentOS installs, in /usr/share/tk8.5/demos, there are a number of
Tcl/Tk demos you can run.  If Tcl and Tk are working, then I would move
to reinstalling tkinter.

[toc] | [prev] | [next] | [standalone]


#98774

FromTim Daneliuk <tundraBOGUS@tundraware.com>
Date2015-11-13 16:09 -0600
Message-ID<56465FAA.5060809@tundraware.com>
In reply to#98762
On 11/13/2015 01:58 PM, Michael Torrie wrote:
> On 11/13/2015 12:14 PM, Tim Daneliuk wrote:
>> On 11/13/2015 12:32 AM, Christian Gollwitzer wrote:
>>> Apfelkiste:Sources chris$
>>
>> Well, I get window and when I do this:
>>
>> pack [button .b -text Hello -command exit]
>>
>> Nothing appears.
>>
>> tkinter appears borked
>>
>> I have reinstalled once already, will try again
> 
> Tkinter is the name of the Python package for using Tk, but Tk itself is
> usually called Tk (package on Fedora and RHEL is tk).
> 
> On my CentOS installs, in /usr/share/tk8.5/demos, there are a number of
> Tcl/Tk demos you can run.  If Tcl and Tk are working, then I would move
> to reinstalling tkinter.
> 

Yep, tcl/tk is borked.  That would explain why pure X apps like xterm work, but not tkinter apps.
Reinstalling tcl/tk has not helped at all.  Now I am really curious what the interaction is between VPS and tk... Sigh. 


(Thanks)

[toc] | [prev] | [next] | [standalone]


#98771

FromChristian Gollwitzer <auriocus@gmx.de>
Date2015-11-13 22:30 +0100
Message-ID<n25klu$rij$1@dont-email.me>
In reply to#98756
Am 13.11.15 um 20:14 schrieb Tim Daneliuk:
> On 11/13/2015 12:32 AM, Christian Gollwitzer wrote:
>> Apfelkiste:Sources chris$
>
> Well, I get window and when I do this:
>
> pack [button .b -text Hello -command exit]
>
> Nothing appears.

No error, nothing? Just to be sure, you haven't closed the empty window, 
that appeared when you typed "wish"? and copied the command into the 
wish prompt?

> tkinter appears borked
> I have reinstalled once already, will try again

This is using pure Tcl/Tk. If it is not working, reinstall the 
corresponding packages in your distro. tkinter is merely the Python 
interface to those.

	Christian

[toc] | [prev] | [next] | [standalone]


#98776

FromTim Daneliuk <tundraBOGUS@tundraware.com>
Date2015-11-13 16:10 -0600
Message-ID<56465FE2.40701@tundraware.com>
In reply to#98771
On 11/13/2015 03:30 PM, Christian Gollwitzer wrote:
> Am 13.11.15 um 20:14 schrieb Tim Daneliuk:
>> On 11/13/2015 12:32 AM, Christian Gollwitzer wrote:
>>> Apfelkiste:Sources chris$
>>
>> Well, I get window and when I do this:
>>
>> pack [button .b -text Hello -command exit]
>>
>> Nothing appears.
> 
> No error, nothing? Just to be sure, you haven't closed the empty window, that appeared when you typed "wish"? and copied the command into the wish prompt?
> 
>> tkinter appears borked
>> I have reinstalled once already, will try again
> 
> This is using pure Tcl/Tk. If it is not working, reinstall the corresponding packages in your distro. tkinter is merely the Python interface to those.
> 
>     Christian

Yep tcl/tk is the culprit, but reinstalling has not helped.

[toc] | [prev] | [next] | [standalone]


#98799

FromChristian Gollwitzer <auriocus@gmx.de>
Date2015-11-14 09:14 +0100
Message-ID<n26qc8$8fl$1@dont-email.me>
In reply to#98776
Am 13.11.15 um 23:10 schrieb Tim Daneliuk:
> On 11/13/2015 03:30 PM, Christian Gollwitzer wrote:
>> Am 13.11.15 um 20:14 schrieb Tim Daneliuk:
>>> On 11/13/2015 12:32 AM, Christian Gollwitzer wrote:
>>>> Apfelkiste:Sources chris$
>>>
>>> Well, I get window and when I do this:
>>>
>>> pack [button .b -text Hello -command exit]
>>>
>>> Nothing appears.
>>
>> No error, nothing? Just to be sure, you haven't closed the empty
>> window, that appeared when you typed "wish"? and copied the command
>> into the wish prompt?
>>
>>> tkinter appears borked I have reinstalled once already, will try
>>> again
>>
>> This is using pure Tcl/Tk. If it is not working, reinstall the
>> corresponding packages in your distro. tkinter is merely the Python
>> interface to those.
>>
>> Christian
>
> Yep tcl/tk is the culprit, but reinstalling has not helped.

I am still not understanding, what actually happened. Does the wish 
shell crash, does it simply exit, or hang? Is there no error message?

You can try if a different/newer version works for your setup. For 
example, you could download a copy of a tclkit from here:

	http://tclkits.rkeene.org/fossil/wiki/Downloads

presumably the 8.6.3 version for RHEL5, and try if it runs a script like 
this

# the next line should make an empty window appear
package require Tk
# this line should create the button in it
pack [button .b -text Hello -command exit]

If this does work, then installing Tcl/Tk from scratch (i.e. copmiling 
yourself) might work.
(Unfortunately, you cannot make tkinter work with a Tclkit)

	Christian

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web