Hey so I was just working with customtkinter yesterday and everything worked fine, I saved the file and went to sleep, This morning i woke up and ran the file and i get this error
C:\Users\removed>C:/Users/removed/AppData/Local/Programs/Python/Python312/python.exe c:/Usersremoved/CustomTkInter.py
Traceback (most recent call last):
File "c:\Users\removed\CustomTkInter.py", line 1, in <module>
import customtkinter
File "C:\Users\removed\AppData\Local\Programs\Python\Python312\Lib\site-packages\customtkinter\__init__.py", line 5, in <module>
from tkinter import Variable, StringVar, IntVar, DoubleVar, BooleanVar
ImportError: cannot import name 'Variable' from 'tkinter' (c:\Users\REMOVED\tkinter.py)
( PS i removed my name from the error message that’s why you will see “removed”. )
I’ve tried reinstalling customtkinter and it doesn’t work.
Im not sure what’s happening, Here’s the code if anyone could help me out here!
import customtkinter
customtkinter.set_appearance_mode("System")
customtkinter.set_default_color_theme("green")
root = customtkinter.CTk()
root.geometry("600x600")
def login():
label2 = customtkinter.CTkLabel(master=frame, text="Successfully logged in..")
label2.pack(pady=12, padx=10)
frame = customtkinter.CTkFrame(master=root)
frame.pack(pady=20, padx=60, fill="both", expand=True)
label = customtkinter.CTkLabel(master=frame, text="Login System", font=("System", 24))
label.pack(pady=12, padx=10)
entry1 = customtkinter.CTkEntry(master=frame, placeholder_text="Username",fg_color="#292828")
entry1.pack(pady=12, padx=10)
entry2 = customtkinter.CTkEntry(master=frame, placeholder_text="Password", show="*",fg_color="#292828")
entry2.pack(pady=12, padx=10)
button = customtkinter.CTkButton(master=frame, text="login", command=login)
button.pack(pady=12, padx=10)
checkbox = customtkinter.CTkCheckBox(master=frame, text="Remember Me")
checkbox.pack(pady=12, padx=10)
root.mainloop()
Ps this doesnt work with anything that uses customtkinter, I removed all the buttons, frames etc and had a blank customtkinter project and i still get this error.