Ben Finney wrote: > Welcome, Michael! > > MICHAEL BASHAGI <myakayebash...@gmail.com> writes: > >> when i run those codes i get this error message:- > > When showing an error, please show the entire traceback; it usually > contains information useful for diagnosing the problem. > >> AttributeError: type object 'Image' has no attribute 'open' > > In this case, I'm fairly sure the line producing this error is:: > > image = Image.open("logo.jpg") > > And Python is correct, the ‘Image’ type has no ‘open’ attribute. What > leads you to think that would work? If there is some article online > telling you to use that, it's incorrect; please help us to correct that.
There are a few things around called `Image`. The code the OP is trying to adapt probably uses the Image from the PIL: import tkinter from PIL import ImageTk from PIL import Image mGui = tkinter.Tk() image = Image.open("logo.jpg") photo = ImageTk.PhotoImage(image=image) Logo = tkinter.Label(mGui, image=photo) Logo.grid(row=0, column=3) mGui.mainloop() This can be simplified: import tkinter from PIL import ImageTk mGui = tkinter.Tk() photo = ImageTk.PhotoImage(file="logo.jpg") Logo = tkinter.Label(mGui, image=photo) Logo.grid(row=0, column=3) mGui.mainloop() _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor