title: Problems with Images in Python's Tkinter
body: <p>I have been trying to include images in my Tkinter widgets, but nothing seems to work. Here's my code:</p>
  
  <pre><code>from Tkinter import *
  from PIL import Image
  
  root = Tk()
  image = Image.open('images/myimage.jpg')
  root.image = image
  b = Radiobutton(root, text='Image',image=image,value='I')
  b.pack()
  root.mainloop()
  </code></pre>
  
  <p>The error I get is:
  Trac</p>
  
  <pre><code>eback (most recent call last):
    File "C:/Users/.../loadimages.py", line 7, in &lt;module&gt;
      b = Radiobutton(root, text='Image',image=image,value='I')
    File "C:\Python27\lib\lib-tk\Tkinter.py", line 2714, in __init__
      Widget.__init__(self, master, 'radiobutton', cnf, kw)
    File "C:\Python27\lib\lib-tk\Tkinter.py", line 1974, in __init__
      (widgetName, self._w) + extra + self._options(cnf))
  TclError: image "&lt;PIL.JpegImagePlugin.JpegImageFile image mode=RGB size=402x439 at 0x2A6B080&gt;" doesn't exist
  </code></pre>
  
  <p>Most internet sources suggest keeping a reference to the image to avoid the garbage collector, but I don't see how I could do that more than what I have here. There are also suggestions regarding having multiple Tk instances, but I only have one.</p>
  
  <p>To whoever helps, thanks in advance!</p>