Wednesday, June 15, 2011

Python and Tkinter on Windows

I'm currently taking a beginners course on line at KTH.se. I noticed too late that it was based on programming in Python; but programming is programming after all and it may impress someone ;).

Anyway. I'm trying to complete the final task and for a good grade I have to build a GUI using Tkinter. I found a tutorial but I've been going mad for the last hour or so.

Python has kept saying "ImportError: No module named Tkinter". No matter what i did.

Finally I found the solution. For some reason (that makes no sense at all) it is case sensitive and only lower case letters should be used in the windows enviroment.

Thus the "import Tkinter" is wrong. It should be "import tkinter" without the capital T.