title: How to add a URL image to Tkinter in Python 2.7 using only the standard Python library?
body: <p>I have seen many examples of how to show images in Tkinter using an image URL but none of those examples are working for me i.e.</p>
  
  <pre><code>import urllib 
  from Tkinter import *
  import io
  from PIL import Image, ImageTk
  
  
  app = Tk()
  app.geometry("1000x800")
  
  im = None  #&lt;-- im is global
  
  def search():
      global im  #&lt;-- declar im as global, so that you can write to it
                 # not needed if you only want to read from global variable.
      tx1get = tx1.get()
      Label(app, text="You Entered: \"" + tx1get + "\"").grid(row=1, column=0)
      fd = urllib.urlopen("http://ia.media-imdb.com/images/M/MV5BMTc2MTU4ODI5MF5BMl5BanBnXkFtZTcwODI2MzAyOA@@._V1_SY317_CR7,0,214,317_AL_.jpg")
      imgFile = io.BytesIO(fd.read())
      im = ImageTk.PhotoImage(Image.open(imgFile))
      image = Label(app, image = im, bg = "blue")
      image.grid(row=2, column=0)
  
  tx1=StringVar()
  tf = Entry(app, textvariable=tx1, width="100")
  b1 = Button(app, text="Search", command=search, width="10")
  tf.grid(row=0, column=0)
  b1.grid(row=0, column=1)
  
  app.mainloop()
  </code></pre>
  
  <p>When I run this I get the error "No module name PIL" And in this one:</p>
  
  <pre><code>from io import BytesIO
  import urllib
  import urllib.request
  import tkinter as tk
  from PIL import Image, ImageTk
  root = tk.Tk()
  url = "http://imgs.xkcd.com/comics/python.png"
  with urllib.request.urlopen(url) as u:
      raw_data = u.read()
  im = Image.open(BytesIO(raw_data))
  image = ImageTk.PhotoImage(im)
  label = tk.Label(image=image)
  label.pack()
  root.mainloop()
  </code></pre>
  
  <p>I get "No module name request" Nearly all examples make use of the PIL module among others, but I cannot get them to work because Python 2.7 doesn't recognize many of them. I need to display an image as a part of an assessment and while we can import things such as Tkinter, the file needs to run without having to add modules from outside the standard Python library.</p>
  
  <p>It is worth noting as well that I can't even import "tkinter". It will say there is no module named "tkinter" because it needs to start with a capital "T". </p>
  
  <p>So my questions are:</p>
  
  <ol>
  <li><p>Does PIL need me to install additional software/libraries</p></li>
  <li><p>Does the importation of "tkinter" without the capital "T" not work because I am using Python 2.7?</p></li>
  <li><p>Using Python 2.7 how do I display an image in a Tkinter window from a URL</p></li>
  </ol>