Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Python on Max osx and tkinter

0 views
Skip to first unread message

Ralf Wieseler

unread,
Dec 25, 2003, 5:23:01 AM12/25/03
to
Hello! I'm quite new to Python.

I wrote some little scripts using the "import from tkinter" Statemant
that work well on Windows and Linux. but if i try to execute them in my
Powerbook with Mac OSX 10.2.8 i get only Errors. I imorted the TKinter
Module with the Package Manager of MacPython 2.3 but it doesn't work.
My Macphython has no idea of TKinter.
Whats wrong?

Thanks for any help!

Greetz Ralf

Ron Stephens

unread,
Dec 25, 2003, 11:34:17 AM12/25/03
to
Ralf Wieseler <r.wie...@t-online.de> wrote in message news:<bsedqg$rf$00$1...@news.t-online.com>...

Hmm, I also had problems gettign Tkinter properly installed on early
versions of Mac OS X. I finally did succeed, but it was difficult and
I'm not sure I can tell you what the secret was ;-(((

My best advice is to install the latest version of Mac OS X10.3
(Panther). I was successful installing Tkinter on Panther the first
time with no difficulties.

Russell E. Owen

unread,
Dec 26, 2003, 6:25:40 PM12/26/03
to
In article <bsedqg$rf$00$1...@news.t-online.com>,
Ralf Wieseler <r.wie...@t-online.de> wrote:

What I did that worked on Jaguar:
- Installed MacPython 2.3 for Jaguar using the binary installer from:
<http://homepages.cwi.nl/~jack/macpython/macpython-osx.html>
- Installed Tcl/Tk 8.4.4 using the binary installer from
<http://www.maths.mq.edu.au/~steffen/tcltk/TclTkAqua/>
- Used Package Manager (in /Applications/MacPython) to install _tkinter
(and also readlines and some other useful stuff)

At that point you ought to be able to open a NEW terminal window (tcsh
caches some info, so an existing window will probably NOT work) and type
"pythonw" (not "python", that would result in a GUI you cannot bring to
the front) and you're in business:

import Tkinter
root = Tkinter.Tk()

should bring up a window. (By the way "import from tkinter" will not
work. The T in Tkinter is capitalized, and I don't think "import from
<package>" is valid python.

If that does not work for you, can you be more specific about how it
fails?

-- Russell

P.S. for Panther, you can use the same technique, but make sure you
install MacPython 2.3 for Panther instead of for Jaguar, or you'll end
up with a mess. Panther already includes a usable MacPython (and two
copies do not coexist well), so the MacPython installer only adds some
extra components.

George Trojan

unread,
Dec 27, 2003, 10:52:18 AM12/27/03
to
I have Mac OS X 10.3 (7B85). Tkinter that came with the OS does not work
for me:

> trojan$ python
> Python 2.3 (#1, Sep 13 2003, 00:49:11)
> [GCC 3.3 20030304 (Apple Computer, Inc. build 1495)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
>>>> import Tkinter
> Traceback (most recent call last):
> File "<stdin>", line 1, in ?
> File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/lib-tk/Tkinter.py", line 38, in ?
> import _tkinter # If this fails your Python may not be configured for Tk
> ImportError: No module named _tkinter

I am a newcomer to Mac, don't know whether this is a build issue (shared
library for _tkinter was not linked) or a configuration problem.
I guess I will have to build another version, after installing Tk and X11.

George

Aahz

unread,
Dec 29, 2003, 11:09:51 AM12/29/03
to
In article <bsig1m$njq$1...@nntp6.u.washington.edu>,

Russell E. Owen <n...@spam.invalid> wrote:
>
>What I did that worked on Jaguar:
>- Installed MacPython 2.3 for Jaguar using the binary installer from:
><http://homepages.cwi.nl/~jack/macpython/macpython-osx.html>
>- Installed Tcl/Tk 8.4.4 using the binary installer from
><http://www.maths.mq.edu.au/~steffen/tcltk/TclTkAqua/>
>- Used Package Manager (in /Applications/MacPython) to install _tkinter
>(and also readlines and some other useful stuff)

Thanks! That's a clear explanation that probably ought to be on the
MacPython page. (Haven't finished yet, but I'll take your word that it
works.)

>At that point you ought to be able to open a NEW terminal window (tcsh
>caches some info, so an existing window will probably NOT work) and type
>"pythonw" (not "python", that would result in a GUI you cannot bring to
>the front) and you're in business:

``rehash`` ought to find ``pythonw``
--
Aahz (aa...@pythoncraft.com) <*> http://www.pythoncraft.com/

Weinberg's Second Law: If builders built buildings the way programmers wrote
programs, then the first woodpecker that came along would destroy civilization.

Ralf Wieseler

unread,
Dec 31, 2003, 5:03:23 AM12/31/03
to
Russell E. Owen schrieb:
Thanks for your great help. That explains a lot of my troubles with
MacPython. a very useful statement. It realy should be on the MacPython
Webside cause i guess there are many people "fighting" with Tkinter and
MacPython!!
I'm really happy now!!

0 new messages