HI
I'm not an expierenced python programmer (yet)
I want to display an image on a screen. I already installed PIL 1.1.6,
and i am using the Tkinter GUI.
I don't know what is missing (or were I went wrong installing the PIL), but this message <see below> is popping up every time.
Traceback (most recent call last):
File "C:\Python26\helpimage.py", line 10, in <module>
tkim = ImageTk.PhotoImage(im) # Convert the image object to a Tkinter PhotoImage object
File "C:\Python26\lib\site-packages\PIL\ImageTk.py", line 116, in __init__
self.paste(image)
File "C:\Python26\lib\site-packages\PIL\ImageTk.py", line 166, in paste
im.load()
File "C:\Python26\lib\site-packages\PIL\ImageFile.py", line 155, in load
self.load_prepare()
File "C:\Python26\lib\site-packages\PIL\ImageFile.py", line 223, in load_prepare
self.im = Image.core.new(self.mode, self.size)
File "C:\Python26\Lib\site-packages\PIL\Image.py", line 36, in __getattr__
raise ImportError("The _imaging C module is not installed")
ImportError: The _imaging C module is not installed
I have found an _imaging.pyd module in the C:\Python26\Lib\site-packages\PIL library.
How can I fix this problem?
< I used this code :
import Tkinter as Tk
import Image
import ImageTk
r = Tk.Tk()
c = Tk.Canvas(r, width=500, height=500)
c.pack(fill='both', expand='yes')
im = Image.open('linux.jpg') # Open a jpeg file into an image object
tkim = ImageTk.PhotoImage(im) # Convert the image object to a Tkinter PhotoImage object
c.create_image(100, 100, image=tkim) # Draw the Tkinter image object on the canvas
>