Today I run into an error using ctk and ttk, and I have no idea how can i fix that.
import customtkinter as ctk
# import ttkbootstrap as ttk
window = ctk.CTk()
button = ctk.CTkButton(window, text = "now it's working")
button.pack()
window.mainloop()
`
The simple code I provided you works as long as the ttk import is commented. If I'm trying to import ttk there is an error:
Traceback (most recent call last):
File "c:\Users\HP\Desktop\python\tkinter\test.py", line 6, in <module>
button = ctk.CTkButton(window, text = "now it's working")
File "C:\Users\HP\anaconda3\envs\game\lib\site-packages\customtkinter\windows\widgets\ctk_button.py", line 95, in __init__
self._canvas = CTkCanvas(master=self,
File "C:\Users\HP\anaconda3\envs\game\lib\site-packages\customtkinter\windows\widgets\core_rendering\ctk_canvas.py", line 31, in __init__
super().__init__(*args, **kwargs)
File "C:\Users\HP\anaconda3\envs\game\lib\site-packages\ttkbootstrap\style.py", line 5169, in __init__wrapper
func(self, *args, **kwargs)
File "C:\Users\HP\anaconda3\envs\game\lib\tkinter\__init__.py", line 2688, in __init__
Widget.__init__(self, master, 'canvas', cnf, kw)
File "C:\Users\HP\anaconda3\envs\game\lib\tkinter\__init__.py", line 2572, in __init__
self.tk.call(
_tkinter.TclError: bad screen distance "175.0"
The error occurs even if I don't use any ttk widgets, variables, objects etc. Just importing the module is enough to break the code
I tried reinstalling both packages ctk and ttk and there is no effect. I couldn't find any similar problem online. The issue is not specific to CTkButtons, other widgets also don't work