Programming and Scripting :: Python and Tk



Has anybody gotten Python working with Tkinter TCL/Tk. I've tried both the 2.3 and 2.5 version and both say they can't find the Tkinter libraries (or weren't compiled for them).

I even tried to recompile myself from sources and ran into the same problem. I couldn't seem to get the Tk libraries to be seen by the Python make file. There are a ton of Python programs that need this to work.

Thanks
-Chad

I haven't done anything with python beyond using it with Blender, so I can't say for sure what might be needed for python-tk or tkinter. When building the tcl/tk extensions, I didn't even take python into consideration.  I'll have to look into that at some point, particularly since I still want to do more tweaking of the tcl/tk extension.

I wonder if it might just need some modification of your environment, such as setting a library path before running python.

I noticed the problem first when I tried to run IDLE the IDE that comes with python. It errors out and says it hasn't been "configured" for Tk. I found that when I tried rebuild python 2.5 from sources I get a warning saying that it couldn't find the Tk libraries. So I'd imagine that they need to be present when python builds or it doesn't even make the tkinter extensions that its GUI library needs later.
The existing Tcl/Tk extensions do not include the headers needed to compile Tcl/Tk applications, so maybe that's why the libraries couldn't be found.
I built a 8.4.14 Tcl/Tk package quite a while ago that includes the necessary headers, but apparently I forgot to mail it to roberts...i don't see it in my "sent" box.
Anyway, in case I don't get around to sending it soon (2K/s uploading is kind of annoying), you should be made aware that Tcl/Tk compiles very easily in DSL.

I built Tcl and Tk from source files, and created .unc extensions for both. They seem to function, but Python still does not seem to recognize the needed files for Tkinter, and thus IDLE.

Perhaps the source package I used did not include the Tkinter libraries or something. Or perhaps my extensions are faulty.

Do I need to use some other package for Python? I am currently using the python2.5.unc file posted in the repository.

- UberMai

Next Page...
original here.