3

I am studying Python and tried to make GUI using python.I am using IDLE 3.2 on 12.04 Ubuntu.When i typed import Tkinter, a error comes, it says following:

Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    import Tkinter
ImportError: No module named Tkinter

Any ideas on what's going wrong and how I can resolve this?

1
  • I have already installed python3-tk.But the same error comes Oct 8, 2013 at 16:05

1 Answer 1

4

You need to install the package python3-tk.

And in Python3 the module is called tkinter instead of Tkinter.

7
  • But i have already installed it?. i can't understand Oct 8, 2013 at 16:03
  • @YomalSamindu: Are you sure you are using Python3? For Python2 you need python-tk instead. Oct 8, 2013 at 16:05
  • yes i am pretty sure. its python 3.2 Oct 8, 2013 at 16:07
  • 3
    @YomalSamindu As a note, alot of capitalization has changed in tkinter between python2 and python3. Check your capitals first for any future problems
    – Dan
    Oct 8, 2013 at 16:25
  • 1
    after i entered import tkinter it worked.THank you very much for your helps. Oct 9, 2013 at 0:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .