0

I'm attempting to build graphics for a calculator I made, but I'm getting an error saying that there's no module tkinter. How do I fix my code so that it correctly imports tkinter?

import sys
from tkinter import*

root = Tk()
frame = Frame(root)
frame.pack()

root.title('Calculator')

root.mainloop()
user6067378
  • 13
  • 1
  • 1
  • 5

1 Answers1

4

Check what python version you have

If you have python 3x:

from tkinter import *

If you have python 2x

from Tkinter import *

If both of those do not work, reinstall tkinter.

Click here to install tkinter

maxadorable
  • 1,290
  • 1
  • 10
  • 24