Python/Tk not working in Linux
Cameron Laird
claird at lairds.us
Sat Aug 12 12:24:25 EDT 2006
In article <pan.2006.08.12.07.25.34.513867 at gmx.net>,
Marc 'BlackJack' Rintsch <bj_666 at gmx.net> wrote:
>In <1155354248.783487.217200 at m79g2000cwm.googlegroups.com>, BinnyVA wrote:
>
>> I am using Fedora Core 3 Linux and I have a problem with Tk in Python.
>> Whenever I try to run a tk script, I get the error...
>>
>> ---------------
>> Traceback (most recent call last):
>> File "Tk.py", line 1, in ?
>> from Tkinter import *
>> File "/usr/local/lib/python2.4/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
>> ---------------
>
>The `_tkinter` module is the binary "bridge" to the Tk system. If it's
>not found it's most likely that the relevant header files of tcl/tk where
>not installed before compiling Python or there was a problem while
>compiling this extension.
>
>This seems to be your self compiled Python. Are you sure you got the same
>error when using the version from your distribution? I would suspect you
>get an `ImportError` on `Tkinter` there. Some distributions move the
>`Tkinter` stuff into an own package. Search for a package called
>`python-tk` or `python-tkinter` or similar.
.
.
.
ALSO, Fedora has been a particular problem at times--I haven't
researched where FC3 is in this regard--because it distributed
non-standard Tk-s that yielded weird breakages. If you're
caught in one of these conflicts, you might not be able to
generate from sources correctly because development headers are
inconsistent with sources.
So: you can generate all of Python and Tk from sources you
believe are clean; or you can take advantage of full binaries,
such as ActivePython, that someone else has made.
More information about the Python-list
mailing list