[Image-SIG] PIL Installation Instructions and end-users

Bernhard Herzog herzog@online.de
04 May 1999 13:57:03 +0200


In the May issue of the Linux Gazette, the Graphics Muse examines vector
drawing programs for Linux. Unfortunately the author wasn't able to
install Sketch because he had problems with intalling PIL and finally
gave up:

	Sketch requires Python v1.5.1 or later, the Python Imaging
	Library, v1.0b1 and Tcl/TK, version 8.0 or later. To build the
	Python Imaging Library (aka PIL) you can't use the RPM version
	of Python - you have to build the python distribution from
	source and install it. This is because you have to build PIL
	under the "Extensions" directory of the Python 1.5 directories.
	Although I have Python 1.5 installed on my stock RH 5.2 box,
	there is no Extensions directory. Plus, if I just made the
	directory where 1.5 is installed (/usr/lib/python1.5), I'd have
	to build the PIL as the root user. Not a good thing. So I
	downloaded the Python 1.5 source, built it, then tried the PIL
	buid. It didn't work - something about missing a config
	directory. And all this before I could even try to build sketch.

An experienced Python/PIL user knows that you don't have build PIL in
the Python source directory and that the missing config files are
probably in the python-devel rpm, but an end user who just wants to
install a drawing program and doesn't care about Python or programming
in general (yet, wait till they discover user scripting... :) ) will
have problems similar to this, I think.

It seems to me that these problems are mostly due to misleading
statements in PIL's README, e.g.:

2. Unpack the PIL distribution (the file Imaging-1.0b1.tar.gz) in your
   Python/Extensions directory.

I therefore propose these changes to the README to make installing PIL
easier:



--- README.~1~	Sat Jan  9 20:58:34 1999
+++ README	Tue May  4 13:31:09 1999
@@ -131,8 +131,9 @@
      the operating system should work just fine.
 
 
-2. Unpack the PIL distribution (the file Imaging-1.0b1.tar.gz) in your
-   Python/Extensions directory.
+2. Unpack the PIL distribution (the file Imaging-1.0b1.tar.gz). If you
+   have the Python sources, your Python/Extensions directory may be a
+   good place, but you can build PIL anywhere you like.
 
 	$ cd Python-1.5/Extensions # example
 	$ gunzip Imaging-1.0b1.tar.gz
@@ -196,13 +197,17 @@
    If you're using Python 1.5 or later, the preferred way is to create
    a "PIL" subdirectory under "site-packages", copy the "PIL.pth" file
    to "site-packages", and the rest of the files to the new subdirectory.
+   If the "site-packages" directory doesn't exist yet create it under
+   Python's lib directory (usually /usr/local/lib/python1.5 or 
+   /usr/lib/python1.5)
 
    Example:
 
-	$ cp PIL.pth /usr/local/lib/Python1.5/site-packages
-	$ mkdir /usr/local/lib/Python1.5/site-packages/PIL
-	$ cp _imaging.so PIL/* /usr/local/lib/Python1.5/site-packages/PIL
-
+	$ cp PIL.pth /usr/local/lib/python1.5/site-packages
+	$ mkdir /usr/local/lib/python1.5/site-packages/PIL
+	$ cp _imaging.so PIL/* /usr/local/lib/python1.5/site-packages/PIL
+	$ cd /usr/local/lib/python1.5/
+	$ python compileall.py site-packages/PIL
 
 * Adding Tkinter support
 



-- 
Bernhard Herzog	  | Sketch, a python based drawing program
herzog@online.de  | http://www.online.de/home/sketch/