Tkinter module not found

Tim Chase python.list at tim.thechases.com
Tue Aug 8 11:55:41 EDT 2006


> The cause of this is usually that you are using a different
> version of Python than the one you installed Tkinter into, but
> being a Linux newbie I have yet to discover how to redirect
> the 'python' command to invoke the newer version of Python.


The OS looks for the first 'python' it finds in its path.

In Linux (or other *nix OSes), you can use

	bash> which python

and it will reply with which python it's pointing to.  You can 
then change into that directory (usually "/usr/bin") and get back 
a listing of various pythons.  On my Debian linux distro at home, 
I get something back that looks like

bash> which python
/usr/bin/python
bash> cd /usr/bin
bash> ls -lsF python* | grep -o "python.*"
python -> python2.3*
python2.3*
python2.4*

You *should* be able to just relink the "python" link to the new 
version of python:

	bash> ln -sf /usr/bin/python2.4 /usr/bin/python

I don't know if this will cause other problems down the line for 
packages that expect the system default.

Alternatively, at least on my system, you can force your choice 
by explicity running "python2.3" or "python2.4" instead of just 
"python".

You can determine your path via

	bash> echo $PATH

along which your shell will search for an executable.

Win32 has a similar executable search path

	c:\> echo %PATH%

but doesn't have something as handy as the "which" command to do 
the hunting for you.

HTH,

-tkc









More information about the Python-list mailing list