faqts : Computers : Programming : Languages : Python : Installation and Configuration

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

24 of 33 people (73%) answered Yes
Recently 2 of 3 people (67%) answered Yes

Entry

How do I install PIL, the Python Image Library?

Mar 12th, 2000 15:07
Steve Holden, Greg Landrum


This is based upon the most recent binary PIL distribution:

   http://www.pythonware.com/downloads/pil-win32-991101.zip

and *requires* that Tkinter is installed on your machine.  It comes by
default with the windows python distributions, so this shouldn't be too
much of a problem.  The binary distribution of PIL appears to require
Tcl/Tk anyway.

Step 1:

   Unzip the archive (it doesn't matter where),
   this will create a directory py152.

   Copy the files/folders from py152 to your Python
   installation directory (c:\program files\python by
   default).


That handles the installation.  Now try running one of the PIL sample
programs (I recommend Scripts/viewer.py).  If you get an error, then
you'll need to move to

Step 2:

   Edit the file c:\program files\python\pil\Image.py
   Move down to around line 47, where you'll find:

       import _imaging

   change this to:

       import sys
       if sys.platform == "win32":
           import FixTk # Attempt to configure Tcl/Tk without PATH
       import _imaging

Save the file and try running Scripts/viewer.py again.  It ought to 
work.


I hope this is helpful.
-greg