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?

  • I have already installed python3-tk.But the same error comes – Yomal Amarathunge Oct 8 '13 at 16:05
4

You need to install the package python3-tk.

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

  • But i have already installed it?. i can't understand – Yomal Amarathunge Oct 8 '13 at 16:03
  • @YomalSamindu: Are you sure you are using Python3? For Python2 you need python-tk instead. – Florian Diesch Oct 8 '13 at 16:05
  • yes i am pretty sure. its python 3.2 – Yomal Amarathunge Oct 8 '13 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 '13 at 16:25
  • 1
    after i entered import tkinter it worked.THank you very much for your helps. – Yomal Amarathunge Oct 9 '13 at 0:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.