I use python3.7 and 8.6version of Tkinter.
I'm studying to use Tkinter and the problem occurred.
The code is
from tkinter import *
root = Tk()
root.title("Nado GUI")
photo = PhotoImage(file="image.png")
btn6 = Button(root, image = photo)
btn6.pack()
#작동안됨...
root.mainloop()
and the error is
/usr/local/anaconda3/envs/python_GUI/bin/python /Users/junil/PycharmProjects/Python_GUI/2_button.py Traceback (most recent call last): File "/Users/junil/PycharmProjects/Python_GUI/2_button.py", line 22, in photo = PhotoImage(file="image.png") File "/usr/local/anaconda3/envs/python_GUI/lib/python3.7/tkinter/init.py", line 3545, in init Image.init(self, 'photo', name, cnf, master, **kw) File "/usr/local/anaconda3/envs/python_GUI/lib/python3.7/tkinter/init.py", line 3501, in init self.tk.call(('image', 'create', imgtype, name,) + options) _tkinter.TclError: couldn't open "image.png": no such file or directory Process finished with exit code 1
I did use python2.7, PIL, and change to gif format but those didn't work.
Please help me to learn.