_tkinter.TclError: image "..." doesn't exist _tkinter.TclError: image "..." doesn't exist tkinter tkinter

_tkinter.TclError: image "..." doesn't exist


You should use PhotoImage instance as image value. Also, you need to keep the reference of your image.

im = Image.open(pathToImage)ph = ImageTk.PhotoImage(im)label = Label(window, image=ph)label.image=ph  #need to keep the reference of your image to avoid garbage collection


A quick hacky fix is to provide the PhotoImage with the correct master:

i = ImageTk.PhotoImage(pathToImage, master=window)


It seems to be an Anaconda - Spyder - Iphyton problem.Solution is here:_tkinter.TclError: image "pyimage" doesn't exist