Tkinter doesnt contain any tk attribute.
import tkinter
window = tkinter.Tk()
win.mainloop()
While running this code it gives me an error
Did you named your python file tkinter.py or Tkinter.py ? Try to rename it. It may be the cause.
try 'Tk' instead of 'tk' it worked for me, if you think you are importing wrong,try: import tkinter tkinter._test()
Try copying the file to the Python path in C drive (in my case)
And the folder should not contain any other file named Tkinter.py or similar for Code click here
Python 3.x
import tkinter
window = tkinter.Tk()
window.mainloop()
import tkinter
raiz= tkinter.Tk()
raiz.mainloop()
remember that the file name cannot be tkinter.py