Sunday, January 23, 2011

Python 3: Problem with Tkinter Tutorial

Problem:
I was searching GUI toolkit for Python 3.1.3, and I came across this hello world example (for Python 2) which utilize Tkinter. The code looks simple enough, so I gave it a try but got the following error:
Traceback (most recent call last):
  File "C:\hello_world.py", line 1, in module
    from Tkinter import *
ImportError: No module named Tkinter

Solution:
Simply change the module name to "tkinter" (lower case) instead.

Ref:
Problems with Python 3 and Tkinter

1 comment:

Anonymous said...

Thanks. This was helpful to me.