Module 'tkinter' has no attribute 'Tk'

前端 未结 5 870
傲寒
傲寒 2020-11-30 15:32

Tkinter doesnt contain any tk attribute.

import tkinter

window = tkinter.Tk()

win.mainloop()

While running this code it gives me an error

5条回答
  •  暖寄归人
    2020-11-30 16:06

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

提交回复
热议问题