title: Opening a JPEG Image in Python
body: <p>I am running into a problem opening jpeg images in Python 2.7 using the following code.</p>
  
  <pre><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() 
  </code></pre>
  
  <p>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.</p>
  
  <p>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. </p>
  
  <pre><code>import Image
  
  image = Image.open('File.jpg')
  image.show()
  </code></pre>
  
  <p>Any help would be appreciated. </p>