tkinter PhotoImage doesn't exist?

Viewed 7709
from tkinter import *

root = Tk()

photo = PhotoImage(file='blueface.png')
label = Label(root, image=photo)
label.pack()

root.mainloop()

The image face.png is in the same directory as this .py script, but when I run it, I get the following error:

 line 5, in <module>
    photo = PhotoImage(file='blueface.png')
 line 3539, in __init__
    Image.__init__(self, 'photo', name, cnf, master, **kw)
 line 3495, in __init__
    self.tk.call(('image', 'create', imgtype, name,) + options)
_tkinter.TclError: couldn't open "face.png": no such file or directory
2 Answers
Related