I'm trying to display an image from a specific folder, but the error "_tkinter.TclError: image "pyimage2" doesn't exist" is showing. I have verified the image path, and it's correct.
This is a project where many nested functions are called. I suppose this may be the cause of the error, since I have tried this isolated function in another app and it's working properly.
def display_image(csv_file_name, df, frame):
# Create image path
image_path = current_folder_path + '/' + csv_file_name + '.png'
# Create image widget
my_image = customtkinter.CTkImage(Image.open(image_path), size=(25, 25))
# Create label to display image
image_label = customtkinter.CTkLabel(frame, text="", image=my_image)
image_label.pack()
_tkinter.TclError: image "pyimage2" doesn't exist