Compilation of _tkinter, tcl/tk bindings

mg mg.mailing-list at laposte.net
Fri Oct 14 08:14:41 EDT 2005


Hello,

First, I installed Python on a traditionnal default linux-x86 platform 
(tk.h is located in /usr/include) and I did not meet any problem. I can 
write the following instruction without error  in my python interpreter:

./configure --prefix=/usr/local/python
make
make install
/usr/local/python/bin/python
 >>> import Tkinter
 >>>

Second, I tried to install python on IBM-Aix5.1 with tk bindings too. 
Because of tcl/tk doesn't exist on my default platform, I have installed 
tcl8.4.11 in /usr/local/tcl8.4.11. Now, I ran the compilation of Python 
and tried to import Tkinter :

./configure --prefix=/usr/local/python
make
make install
/usr/local/python/bin/python
 >>> import Tkinter
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/local/python/lib/python2.5/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
 >>>

In fact, when Python is compiled, the shared library _tkinter.so should 
be compiled (Tkinter.py is just a Python script which import 
_tkinter.so) if tk is detected on the platform.

So, my questions are :
- Must I install tcl/tk in the default directories give by the 
distribution to compile python and Tkinter (_tkinter) ?
- or can I specify the tcl/tk installation to compile Python and Tkinter 
(_tkinter) ?

Regards,
Mathieu.




More information about the Python-list mailing list