Every time I'm getting this error:
_tkinter.TclError: image "pyimage2" doesn't exist
When I want to execute this code:
self.frame1 = customtkinter.CTkFrame(self)
self.frame1.pack(fill="both", padx=20, pady=20)
book_image = customtkinter.CTkImage(Image.open(self.thumbnail_path))
image_label = customtkinter.CTkLabel(self.frame1, image=book_image, text="")
image_label.pack(side=customtkinter.LEFT, padx=10, pady=10)
The path is here:
self.filename = f"{random.randint(10000, 100000)}.png"
self.thumbnail_path = os.path.join(cache_dir, self.filename)
self.cache_file = os.path.join(cache_dir, self.filename)
if not os.path.exists(self.cache_file):
urllib.request.urlretrieve(self.thumbnail, self.cache_file)
The image should be placed in a CTkToplevel (via a class) which is called by the root window. If it's helpful(?); I'm using a Mac
Tkorcustomtkinter.CTk. It is better to provide a minimal reproducible example in order to identify the cause.