[Tkinter-discuss] Python 3.3.0a3 on Macs
Ned Deily
nad at acm.org
Sat May 12 07:18:57 CEST 2012
In article
<CABaQFFGV6s=RX-D-Y0Ot2jMk4tx6sWVBp-_HDrZACaY7s0_Oyw at mail.gmail.com>,
"Michael O'Donnell" <michael.odonnell at uam.es> wrote:
> Just tried the latest release of Python 3.3.0a3
> (v3.3.0a3:0b53b70a40a0, May 1 2012, 11:10:44)
> on my MacOSX Lion.
>
> It seems use of tkinter NoteBook breaks:
>
> from tkinter import *
> import tkinter.ttk
> root = Tk()
> nb=tkinter.ttk.Notebook(root)
> nb.pack(expand=True, fill=BOTH)
> nb.add(Canvas(nb, bg="red"), text="Pane 1")
> nb.add(Canvas(nb, bg="blue"), text="Pane 2")
> root.mainloop()
>
> Traceback (most recent call last):
> File "/Users/micko/Google Drive/ALL_FILES/TO
> DO/CorpusTool30b1/NotebookTest.py", line 5, in <module>
> nb=tkinter.ttk.Notebook(root)
> File
> "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/tkinter/ttk
> .py",
> line 857, in __init__
> Widget.__init__(self, master, "ttk::notebook", kw)
> File
> "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/tkinter/ttk
> .py",
> line 559, in __init__
> _load_tile(master)
> File
> "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/tkinter/ttk
> .py",
> line 47, in _load_tile
> master.tk.eval('package require tile') # TclError may be raised here
> _tkinter.TclError: can't find package tile
>
> Now, I though Tile had been folded into Tkinter. Or do I need to
> download and install it separately still?
Your example works for me on 10.7.4 with the same version of Python
3.3.0a3. Two comments: first, you appear to be using the 32-bit-only
version of Python 3.3 from python.org. It's not recommended to use that
version on OS X 10.7 unless you need compatibility with OS X 10.5 and
earlier. Otherwise, it's better to use the 64-/32-bit installer
variant. One reason is that the 32-bit version will usually be more
problematic if you need to build and install third-party packages that
have C extension modules, although at this alpha stage of 3.3.0 both
variants will likely have problems due to the changes in the Xcode 4.3
command line tools. (These will be fixed in an upcoming alpha.)
Another reason to use the 64-/32-bit variant is that it is built to use
Tcl/Tk 8.5, whereas the 32-bit-only variant uses Tcl/Tk 8.4. Second,
assuming the license is acceptable, try installing the latest ActiveTcl,
8.5 for the 64-/32-bit variant or 8.4 for the 32-bit-only variant.
There are known problems with the Apple-supplied Tcl/Tk 8.5 in 10.7 (and
huge problems with the one in 10.6) that are fixed in the most recent
ActiveTcl version. The python.org Pythons will automatically use the
ActiveTcl versions if they are installed. See here for more details:
http://www.python.org/download/mac/tcltk/
--
Ned Deily,
nad at acm.org
More information about the Tkinter-discuss
mailing list