[Tutor] Python 1.5.2 on iBook running Mac OS 9

Corran Webster cwebster@nevada.edu
Thu, 23 Mar 2000 10:51:23 -0800


This is a question which perhaps belongs in the MacPython SIG - you will
certainly be able to find help there on technical mac-related issues like
this.

At 8:35 PM -0500 21/3/00, Charles Evans wrote:
> Long ago, on an older Mac, I puttered around with Programming Python
> with moderate success, and was able to get Tkinter examples to run.
>
> Today, I installed Python 1.5.2 on my iBook, running Mac OS 9, and when
> I try to import Tkinter, I get an error code indicating that no such
> module exists.
>
> I installed Tkinter, and verified that it is in Lib/lib-tkinter.
>
> Am I doing something wrong, or has anyone encountered problems with OS 9
> and Python 1.5.2?

Unfortunately, in 1.5.2 the locations that modules are stored in were
changed, and in that change the location of _tkinter was omitted from the
standard path.

To make things work, you need to find _tkinter.ppc.slb (which is, I
believe, somewhere in the :Extensions:Imaging folder) and move it to
somewhere in your python search path (:Mac:Plugins is the usual location).

After you have done this, you will need to make sure that :Lib:lib-tk is in
your python path.  Run the "EditPythonPrefs" file and add the line

$(PYTHON):Lib:lib-tk

to the list if it is not already there.

This should get you back to the same amount of support for Tk as previous
versions of Python for the Mac.

Also, you will have to run Tkinter based scripts using the interpreter,
rather than the IDE.

Regards,
Corran