[PythonCE] weird Tkinter

Progor dpwhittaker at gmail.com
Tue Feb 27 17:27:59 CET 2007

I wish it were that easy.  This process included 20-something soft resets,
none of which were able to solve this problem.  I am pretty new to python,
so if you can help me understand why:

import _tkinter
import Tkinter

works, but:

import Tkinter

alone doesn't work, then maybe we can find a solution to the whole problem.

I assume import _tkinter is asking it to import the dll itself, and somehow
the Tkinter package isn't making it that far.

Ok.  I made it a bit further.  I found a Tkinter.py and Tkinter.pyc file in
one of the threads on this topic a bit back and added them to my Lib
directory.  That did nothing, but then I renamed Tkinter.pyc in
python25.zip/lib-tk to Tkinterold.pyc (Resco File Explorer ftw) so python
would be sure to use the one in Lib, and finally, it works.  Oddly enough,
clicking on the .py version gives a could not find TCL DLL message (on the
import _tkinter line), but clicking on the .pyc gives the little demo
window.  Even weirder, moving that .pyc file into the zip under lib-tk takes
me back to the original problem (not finding TK DLL).  Yes, I soft reset
between every file move operation and test.

Well, dangit, I must have gotten lucky on a soft reset here or there or
still had the DLL loaded into memory from something else or... who knows... 
I'm still getting the "could not find TK DLL" message, with either version
or location of Tkinter.pyc... most of the time.

Bandung wrote:
> A soft reset is your friend.  Do it and your python install/tkinter will
> return to normal.  I don't know why at times "stuff" happens but it does.
> Progor wrote:
>> So, I think I might have my install kinda borked.  I finally got it
>> working, but I had to jump through some hoops to make it work.
>> First, I installed PythonCE with CABINSTL directly into /Python (I switch
>> SD cards all the time, wanted it in main memory (for speed too), but with
>> as few spaces as possible for command line stuff).
>> Then, I tried just doing an import Tkinter from the console, but it gave
>> me the notorious missing TK DLL message.
>> So, I found the dlls (celib, tk84, tcl84) and put them in /Windows, but
>> it still gave me the error.
>> So, I played around with it a bit.  I found out if I import _tkinter
>> first, then it doesn't give me the message... but that's an extra line in
>> all my programs and may be weird if I ever want to give out my programs.
>> I kept looking around on this mailing list and finally figured out I
>> needed to install tcl as well, did that, but I still have to import
>> _tkinter before I can import Tkinter without getting the "Could not find
>> TK DLL" error.
>> It sounds like some people have gotten it to work on their systems
>> without the weird "import _tkinter" extra line.  Have I done something
>> wrong?  Or is Tkinter just that persnickity?

View this message in context: http://www.nabble.com/weird-Tkinter-tf3297520.html#a9185914
Sent from the Python - pythonce mailing list archive at Nabble.com.

More information about the PythonCE mailing list