Q:

Tkinter module error on attributes like Tk or Frame

i am trying to use Tkinter on python 3.6
However it gives me an error when i try to run the following code:
import tkinter
top = tkinter.Tk()
top.mainloop()

The error says:
AttributeError: module 'tkinter' has no attribute 'Tk'

I receive the same error if i try to call the attribute Frame.
Any idea?
Thanks

A:

Make sure you didn't name the file tkinter.py; It prevents import of tkinter module because the file your wrote searched first and imported.
Rename the file, and also make sure there's no tkinter.pyc remained.

