-1

I was trying myself with Tkinter, and I barely started and got this error and I don't know how to fix it.

AttributeError: partially initialized module 'tkinter' has no attribute 'Tk' (most likely due to a circular import)

This is my source code:

import tkinter
window = tkinter.Tk()
window.mainloop
window.geometry("200x200")
wjandrea
  • 28,235
  • 9
  • 60
  • 81

1 Answers1

2

You are using the tkinter library with all the code that makes tkinter function in a file called "tkinter.py". Python is trying to read that file however your file is likely also called "tkinter.py" which doesn't have the required code. You should try renaming your document and moving it to a new file.