By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,097 Members | 1,580 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,097 IT Pros & Developers. It's quick & easy.

Compilation of _tkinter, tcl/tk bindings

P: n/a
mg
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.

Oct 14 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.