Gp_Teeb Asked: 2022-10-03 10:00:13 +0800 CST 2022-10-03 10:00:13 +0800 CST 2022-10-03 10:00:13 +0800 CST Python error inserting an image into a label [closed] 772 When adding an image to a Label, this error appears, could someone help me solve it? The two files are in the same directory python 1 Answers Voted Best Answer GmrYael 2022-10-04T18:48:25+08:002022-10-04T18:48:25+08:00 Hello friend I have an alternative if you still have the error. Try using PILLOW to open the image from tkinter import * from tkinter import ttk from PIL import Image, ImageTk root = Tk() frame = ttk.Frame(root, padding=10) frame.grid() title = ttk.Label(frame, text="Fix Tkinter error SO").grid(column=0, row=0) img = Image.open("prueba.png") img = img.resize((200, 200), Image.ANTIALIAS) label_image = ImageTk.PhotoImage(img) ttk.Label(frame, image=label_image).grid(column=1, row=3) root.mainloop() And this is the result
Hello friend I have an alternative if you still have the error. Try using PILLOW to open the image
And this is the result