How do you import Tkinter in python?


I am trying to learn python, and I took the fallowing peace of code from the internet:

import Tkinter

class simpleapp_tk(Tkinter.Tk):
def init(self,parent):
self.parent = parent

def initialize(self):

    self.entry = Tkinter.Entry(self)

    button = Tkinter.Button(self,text=u"Click me !")

if name == “main”:
app = simpleapp_tk(None)
app.title(‘my application’)

But it keeps giving me the same error message that says;
Traceback (most recent call last):
File “/home/ubuntu/workspace/”, line 1, in
import Tkinter
ImportError: No module named ‘Tkinter’

Here is a picture of my screen:

Can anyone please help?


Please see my response to an identical problem:

If this isn’t the problem, please respond and I’ll try to see if I can figure it out.


I’m having this same issue. When I try to install tkinter with pip in Python 2 or 3, I get the error “Could not find a version that satisfies the requirement tkinter”.

dev:~/environment $ python -m tkinter
/usr/bin/python27: No module named tkinter


It gave me the similar error initially, but then after finding the solution to qualify for instant access, it i felt very silly, some of the devices do not accept the capital T in the tkinter, you have to write import tkinter with a small t.