So I try to show an image in a window by using tkinter. Somehow I always get an IOError
:
IOError: [Errno 2] No such file or directory: 'C:\\Users\\domin\\Desktop\\NEu\\Download.jpg'
or
IOError: [Errno 2] No such file or directory: 'Download.jpg'
The code I am using is from the thread (User: josav09): How to add an image in Tkinter?
I tried using the Imagename and using the direct path. But nothing works. The script and image are in the same folder and the path is the correct one.
Where is my mistake?
Code:
from tkinter import *
from PIL import ImageTk, Image
import os
root = Tk()
img = ImageTk.PhotoImage(Image.open("Download.jpg"))
panel = Label(root, image = img)
panel.pack(side = "bottom", fill = "both", expand = "yes")
root.mainloop()