Module ‘tkinter’ has no attribute ‘Tk’

Did you named your python file tkinter.py or Tkinter.py ? Try to rename it. It may be the cause.

if the file name is tkinter.py in program

import tkinter

it will imports the our file name which is overriders the content there is not Tk() module, so it throw the error

Leave a Comment