Home > database >  self.tk.call(('image', 'create', imgtype, name,) options) _tkinter.TclError: c
self.tk.call(('image', 'create', imgtype, name,) options) _tkinter.TclError: c

Time:03-01

I'm trying to make an app using Python and Tkinter but I'm not able to load an image, or png to be specific. Instead, I'm getting this long error:

 File "C:\Users\username\AppData\Local\Programs\Python\Python310\lib\tkinter\__init__.py", line 4038, in __init__
    self.tk.call(('image', 'create', imgtype, name,)   options)
_tkinter.TclError: couldn't recognize data in image file "image1.png".

Can someone help me fix this? Here are the lines of code that might be causing the error:

cycle1IMG = tk.PhotoImage(file="image1.png")

def openNewWindow1():
    newWindow = Toplevel(master)
    newWindow.title("           
  • Related