I am running into a problem opening jpeg images in Python 2.7 using the following code.
import Tkinter as tk
from PIL import ImageTk, Image
path = 'C:/Python27/chart.jpg'
root = tk.Tk()
img = ImageTk.PhotoImage(Image.open(path))
panel = tk.Label(root, image = img)
panel.pack(side = "bottom", fill = "both", expand = "yes")
root.mainloop()
The jpeg opens just fine but then the code stops running. I want to open the jpeg in the middle of the program but once the image opens none of the remaining code gets executed.
I also tried opening the jpeg using the code below but just get the error "No module named Image". I have installed PIL and it was the correct 2.7 version.
import Image
image = Image.open('File.jpg')
image.show()
Any help would be appreciated.