Python, Tkinter, PIL, Mac problems with displaying images Python, Tkinter, PIL, Mac problems with displaying images tkinter tkinter

Python, Tkinter, PIL, Mac problems with displaying images


Use this instead:

    from PIL, import Images, ImageTk

If your image cannot be displayed in a frame, use a label instead:

    your_image = ImageTk.PhotoImage(image.open('an image.png'))     # note the image has to be in the same directory as your project,     # then     your_label = Label(master=root, image=your_image)     your_label.pack()


use this insteadfrom PIL, import Images, ImageTkthen you image cannot be displayed in a frame, use a label instead

your_image = ImageTk.PhotoImage(image.open('an image.png'))# notethe image has to be in the same directory as your project,# thenyour_label = Label(master=root, image=your_image)your_label.pack()