Tkinter pyimage doesn't exist Tkinter pyimage doesn't exist tkinter tkinter

Tkinter pyimage doesn't exist


Figured it out. For some reason, while running in the debugger, if any previous executions had thrown errors I get the "pyimage doesn't exist" error. However, if I restart the debugger (or no previously executed scripts have thrown errors), then the program runs fine.


I had the same error message when using spyder 3.3.6 the only way i could get the .png file to load and display after getting the 'Tinker pyimage error ' was to go to the Console and restart the kernel. After that i worked fine.


From programmersought

image “pyimage1” doesn’t existBecause there can only be one root window in a program, that is, only one Tk() can exist, other windows can only exist in the form of a top-level window (Toplevel()).

Original code

import tkinter as tkwindow = tk.TK()

Revised code

import tkinter as tkwindow = tk.Toplevel()

Keep other code unchanged

https://www.programmersought.com/article/87961175215/