[Tutor] Tkinter GUI extension [python installation issues with Tk]

Danny Yoo dyoo@hkn.eecs.berkeley.edu
Fri, 25 Jan 2002 18:40:32 -0800 (PST)


On Fri, 25 Jan 2002, David Deuber wrote:

> I'm running on an Irix system and having difficulties installing python
> with the Tkinter GUI extension.  I've downloaded the following code from
> 
> this url -
> 
> http://sourceforge.net/project/showfiles.php?group_id=5470&release_id=66610.
> 
> tcl8.0.5
> tk8.0.5
> Python-2.2


Hi David,

When one compiles Python, during the configuration step, there should be
output that explains what the configurator can find out about your system.  
There should be a 'config.log' file that shows the results of the
configuration.  If you send us that log file, we can what choices the
configurator is making, and, with luck, we might be able to find out
what's going on.



> Thus far I'm able to start python interactive session but not able to
> import Tkinter-
> >>from Tkinter import *
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
>   File "/usr/Python-2.2/Lib/lib-tk/Tkinter.py", line 35, in ?
>     import _tkinter # If this fails your Python may not be configured
> for Tk
> ImportError: No module named _tkinter

Most likely, the configurator wasn't able to find Tk on your system.  Do
you remember where you installed those libraries?  Also, did you install
the developmental include files?


It might just be that the ./configure step is having a hard time
autodetecting the Tk graphics library.  If so, we can manually tell Python
where to look for it.  According to the README in the Python source
distribution:

"""Starting with Python 2.1, the setup.py script at the top of the source
distribution attempts to detect which modules can be built and
automatically compiles them.  Autodetection doesn't always work, so
you can customize the configuration by editing the Modules/Setup file."""

So if worst comes to worse, we can hardcode the path to the Tk libraries
within the Module/Setup file.  But let's look at the log file first and
see what's going on.



> Can you help me find a way to get this to work or point me in the
> correct documention location?  Our system admin suggested I try to
> download a binary version of Python to avoid compiling it.  I'm not
> able to find a binary version for unix , only windows .

Hmmm... You may want to ask on the comp.lang.python newsgroup and see if
anyone has constructed a binary package for Python.  The web site:

    http://freeware.sgi.com/

appears to collect contributed binary packages for IRIX system, so you may
be able to find Python there.



Good luck to you!