Tkinter in Python 2.6 under MacOSX
Hi all, Last I tried (2 days ago), the python 2.6 installer for MacOSX was broken for Tkinter. Discussion on the web suggests that python tries to link against the wrong version of Tk. Even Idle doesn't launch. Have other tkinter users experienced this? Any easy fixes without requiring me to learn how to compile python from scratch? Mick O'Donnell
Michael O'Donnell wrote:
Have other tkinter users experienced this? Any easy fixes without requiring me to learn how to compile python from scratch?
Yes, I'm also unable to use Tkinter with python 2.6 on Mac OS X. There is an open bug about this: http://bugs.python.org/issue4017 Dave
Yes, I'm also unable to use Tkinter with python 2.6 on Mac OS X. There is an open bug about this:
I'm just curious, Given Python is the 6th most popular programming language (http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html) And Tkinter is the default GUI extension. How come a broken distribution of Python 2.6 for Mac can stay on the official site for 6 weeks without being fixed, when it seems its a simple matter to make a fixed binary distrib? (and I know this is not the fault of anyone on this list, I'm just expressing a gripe, I would reallly love to see if the new python on mac fixes my unicode problems). Mick On Mon, Nov 17, 2008 at 8:08 PM, Dave Opstad <dave.opstad@monotypeimaging.com> wrote:
Michael O'Donnell wrote:
Have other tkinter users experienced this? Any easy fixes without requiring me to learn how to compile python from scratch?
Dave
_______________________________________________ Tkinter-discuss mailing list Tkinter-discuss@python.org http://mail.python.org/mailman/listinfo/tkinter-discuss
On Mon, Nov 17, 2008 at 5:57 PM, Michael O'Donnell <michael.odonnell@uam.es> wrote:
Yes, I'm also unable to use Tkinter with python 2.6 on Mac OS X. There is an open bug about this:
I'm just curious,
Given Python is the 6th most popular programming language (http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html)
And Tkinter is the default GUI extension.
How come a broken distribution of Python 2.6 for Mac can stay on the official site for 6 weeks without being fixed, when it seems its a simple matter to make a fixed binary distrib?
I particularly don't have a mac to test the installer there, so I can't do much. So if you know how to fix it would be very nice to submit the patch to the bug tracker, because apparently issue4017 stopped progressing. But if you don't, you could try raising this question on python-dev because this is surely annoying.
(and I know this is not the fault of anyone on this list, I'm just expressing a gripe, I would reallly love to see if the new python on mac fixes my unicode problems).
Mick
On Mon, Nov 17, 2008 at 8:08 PM, Dave Opstad <dave.opstad@monotypeimaging.com> wrote:
Michael O'Donnell wrote:
Have other tkinter users experienced this? Any easy fixes without requiring me to learn how to compile python from scratch?
Dave
_______________________________________________ Tkinter-discuss mailing list Tkinter-discuss@python.org http://mail.python.org/mailman/listinfo/tkinter-discuss
_______________________________________________ Tkinter-discuss mailing list Tkinter-discuss@python.org http://mail.python.org/mailman/listinfo/tkinter-discuss
-- -- Guilherme H. Polo Goncalves
Hi Guilherme,
can't do much. So if you know how to fix it would be very nice to submit the patch to the bug tracker, because apparently issue4017 stopped progressing.
Someone posted to the bugtracker the following: -------------------- [Kevin's post of 6.Oct, 02:58] You can avoid this problem by building Python yourself and putting /Library/Frameworks first on the search path for Tcl/Tk. Look in setup.py in the source code, around line 1438 (in the 'detect_tkinter_darwin' function), and either comment out /System/Library or put it underneath /Library/Frameworks. This is what the official build from Python.org should do--look first in /Library/Frameworks and then fall back on /System/Library/Frameworks. I'm not sure why it doesn't. ------------------- If that is all it takes to fix it, I've no idea why no-one has done that and re-released the macosx distro. I'll try and post on the python-dev list to see if I can get some action. Mick On Mon, Nov 17, 2008 at 10:48 PM, Guilherme Polo <ggpolo@gmail.com> wrote:
On Mon, Nov 17, 2008 at 5:57 PM, Michael O'Donnell <michael.odonnell@uam.es> wrote:
Yes, I'm also unable to use Tkinter with python 2.6 on Mac OS X. There is an open bug about this:
I'm just curious,
Given Python is the 6th most popular programming language (http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html)
And Tkinter is the default GUI extension.
How come a broken distribution of Python 2.6 for Mac can stay on the official site for 6 weeks without being fixed, when it seems its a simple matter to make a fixed binary distrib?
I particularly don't have a mac to test the installer there, so I can't do much. So if you know how to fix it would be very nice to submit the patch to the bug tracker, because apparently issue4017 stopped progressing. But if you don't, you could try raising this question on python-dev because this is surely annoying.
(and I know this is not the fault of anyone on this list, I'm just expressing a gripe, I would reallly love to see if the new python on mac fixes my unicode problems).
Mick
On Mon, Nov 17, 2008 at 8:08 PM, Dave Opstad <dave.opstad@monotypeimaging.com> wrote:
Michael O'Donnell wrote:
Have other tkinter users experienced this? Any easy fixes without requiring me to learn how to compile python from scratch?
Dave
_______________________________________________ Tkinter-discuss mailing list Tkinter-discuss@python.org http://mail.python.org/mailman/listinfo/tkinter-discuss
_______________________________________________ Tkinter-discuss mailing list Tkinter-discuss@python.org http://mail.python.org/mailman/listinfo/tkinter-discuss
-- -- Guilherme H. Polo Goncalves
2008/11/17 Michael O'Donnell <michael.odonnell@uam.es>: [snip]
I would reallly love to see if the new python on mac fixes my unicode problems).
Oh God yes. I've done every kind of voodoo imaginable with Tk8.5 libs and still can't get things to display properly. It's a bit ridiculous. (I'd rewrite everything in PyQt, but I've inherited an app with the Tkinter code kind of spaghetti'd throughout...argh). Fred.
On Tue, Nov 18, 2008 at 3:38 PM, Fred Mailhot <fred.mailhot@gmail.com> wrote:
2008/11/17 Michael O'Donnell <michael.odonnell@uam.es>: [snip]
I would reallly love to see if the new python on mac fixes my unicode problems).
Oh God yes. I've done every kind of voodoo imaginable with Tk8.5 libs and still can't get things to display properly. It's a bit ridiculous. (I'd rewrite everything in PyQt,
But if it is a problem with python on mac then just changing to pyqt won't cut it. Or if it is a problem with python *and* tcl, then I take you have no issues with unicode in pure tcl code, or what ?
but I've inherited an app with the Tkinter code kind of spaghetti'd throughout...argh).
Fred. _______________________________________________ Tkinter-discuss mailing list Tkinter-discuss@python.org http://mail.python.org/mailman/listinfo/tkinter-discuss
-- -- Guilherme H. Polo Goncalves
2008/11/18 Guilherme Polo <ggpolo@gmail.com>: [snip]
But if it is a problem with python on mac then just changing to pyqt won't cut it. Or if it is a problem with python *and* tcl, then I take you have no issues with unicode in pure tcl code, or what ?
[copied from an earlier post of mine to this list] import Tkinter root = Tkinter.Tk() w1 = Tkinter.Button(root, text=u"\u026E", font=("Lucida Grande",24)) w2 = Tkinter.Label(root, text=u"\u026E", font=("Lucida Grande",24)) w1.pack() w2.pack The Button displays the correct character (a digraph from the International Phonetic Alphabet), whereas the Label displays what looks like a Chinese kanji character...the same problem as in 8.4. Also, I verified someone else's (good) suggestion that it might be an endianness issue, but it's not. My understanding was that this would be resolved with Tk8.5, but no dice. Still hoping this will be addressed. Fred.
Michael O'Donnell wrote:
My understanding was that this would be resolved with Tk8.5, but no dice. Still hoping this will be addressed.
:-(
So what was all the fuss about switching to the ATSU code.
Mick
ATSUI is a more modern font rendering technology with support for Unicode. The older font technology in Tk 8.4 was based on QuickDraw, which is obsolete. -- Kevin Walzer Code by Kevin http://www.codebykevin.com
On Tue, Nov 18, 2008 at 7:13 PM, Fred Mailhot <fred.mailhot@gmail.com> wrote:
2008/11/18 Guilherme Polo <ggpolo@gmail.com>: [snip]
But if it is a problem with python on mac then just changing to pyqt won't cut it. Or if it is a problem with python *and* tcl, then I take you have no issues with unicode in pure tcl code, or what ?
[copied from an earlier post of mine to this list]
import Tkinter root = Tkinter.Tk() w1 = Tkinter.Button(root, text=u"\u026E", font=("Lucida Grande",24)) w2 = Tkinter.Label(root, text=u"\u026E", font=("Lucida Grande",24)) w1.pack() w2.pack
The Button displays the correct character (a digraph from the International Phonetic Alphabet), whereas the Label displays what looks like a Chinese kanji character...the same problem as in 8.4.
Also, I verified someone else's (good) suggestion that it might be an endianness issue, but it's not.
My understanding was that this would be resolved with Tk8.5, but no dice. Still hoping this will be addressed.
So running Tk 8.5 with python 2.6 under mac wasn't a problem for you ? This is confusing me because the thread was about this, so I was considering you were in the same boat. Anyway, just to confirm: the code you pasted now, if you convert it to tcl code and run from wish (for example) it doesn't work either right ? There are some problems in the current _tkinter wrapper, I just found one now while reading an issue in the bug tracker (http://bugs.python.org/issue1028) and there are probably others around there, so if it doesn't work while using tkinter it doesn't necessarily means it won't in tcl/tk.
Fred.
-- -- Guilherme H. Polo Goncalves
So running Tk 8.5 with python 2.6 under mac wasn't a problem for you ? This is confusing me because the thread was about this, so I was considering you were in the same boat.
The problem of the strand is that the BINARY distribution of 2.6 doesn't work on Mac. If you download the source, switch two lines (the search path for tkinter libraries), then compile, it will work. My perception is that it is a bit crazy to expect every single user of python/tkinter or idle on the Mac to know how to compile C programs on the Mac, or to want to. Also, why have 100s of people fix a bug, when it could be fixed once and uploaded as a binary. Mick
Michael O'Donnell wrote:
So running Tk 8.5 with python 2.6 under mac wasn't a problem for you ? This is confusing me because the thread was about this, so I was considering you were in the same boat.
The problem of the strand is that the BINARY distribution of 2.6 doesn't work on Mac. If you download the source, switch two lines (the search path for tkinter libraries), then compile, it will work.
My perception is that it is a bit crazy to expect every single user of python/tkinter or idle on the Mac to know how to compile C programs on the Mac, or to want to. Also, why have 100s of people fix a bug, when it could be fixed once and uploaded as a binary.
Mick
Unfortunately, the pace of bug fixes in Python development is slow--it's impossible to predict when a bug fix will get rolled into a new release. Unfortunately as well, some bug fixes are difficult, so you have little choice but to wait for the core developer to fix them. (The bug about Python scripts not running in Terminal when you double-clicked them is an example here.) One thing that you *don't* have to wait for is an updated build of Python itself, if the only issue is how the build is linked. The instructions I posted in the bug report at http://bugs.python.org/issue4017 walk you through the process of correctly building Python against Tk 8.5 on the Mac. They are very simple. Comment out a line or to in the "configure.py" file, and then run the build as usual. Here are the steps as outlined in the Mac README file: ./configure --enable-universalsdk make sudo make install This isn't rocket science. All the steps are worked out for you; all you have to do is run the commands. --Kevin -- Kevin Walzer Code by Kevin http://www.codebykevin.com
But if it is a problem with python on mac then just changing to pyqt won't cut it. Or if it is a problem with python *and* tcl, then I take you have no issues with unicode in pure tcl code, or what ?
No, the problem is that Tk8.4 could not display unicode characters properly on Mac (e.g., chinese chars come out as squares) Supposedly in Tk8.5 they changed the font rendering code to something called ATSU code, which knows how to display unicode properly. So they say. As for Tcl, I used it for years (1996-2003) with unicode text, and it was actually a lot better than python, in that it was totally invisible. Was a shock when I switched to python how many unicode related bugs I got. Mick
Michael O'Donnell wrote:
Hi all,
Last I tried (2 days ago), the python 2.6 installer for MacOSX was broken for Tkinter. Discussion on the web suggests that python tries to link against the wrong version of Tk. Even Idle doesn't launch.
Have other tkinter users experienced this? Any easy fixes without requiring me to learn how to compile python from scratch?
Mick O'Donnell
Nope. You'll have to compile it from scratch. -- Kevin Walzer Code by Kevin http://www.codebykevin.com
participants (5)
-
Dave Opstad -
Fred Mailhot -
Guilherme Polo -
Kevin Walzer -
Michael O'Donnell