Problem Installing PIL (module search path problem I think)

Rhys Ulerich rdu105 at psu.edu
Wed Nov 10 09:21:52 CET 1999


Dumb question I'm sure, but I'm fairly stuck so here goes:

I'm trying to install the Python Image Library (PIL) v1.0
Final on my system (mainly for the sake of using the vector
drawing program sketch).


I've successfully compiled PIL in Python-1.5.2/Imaging-1.0.
The installation instructions provided state that the module
must then be added to a location where Python can find the
PIL library.

I'm going to reproduce some of the install instructions here so
please humor the length of this post...

---8<----
[from within Python-1.5.2/Imaging-1.0/]
8. To build a dynamically loaded module, just type "make":
 
        $ make
 
   This will create a file called "_imaging.so".
 
   Then type (assuming a standard shell):
 
        $ PYTHONPATH=.:./PIL ; export PYTHONPATH
        $ python
 
        >>> import _imaging
        >>> import Image
 
   If both imports works, you've successfully added PIL to your Python
   environment.

9. Copy the "_imaging.so" module and the contents of the "Imaging/PIL"
   directory to a suitable place along the Python path.
 
   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.
 
   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

----8<----

Step 8 listed above works like a charm.  Step 9 is what is giving me
problems.  I couldn't find a Python-1.5.2/site-packages directory so
I created one and then followed the example commands in step 9 to
put PIL.pth and the _imaging.so library into Python-1.5.2/site-packages.
No luck there.

So I edited the PYTHONPATH environmental variable so that
"PYTHONPATH=.:/usr/local/src/Python-1.5.2/site-packages" but
I still had no luck verifying that "import _imaging" and "import
Image" would work as they did in installation step 8 above.


Any ideas?  I'm sure that this is a really simply thing and I'm
just not RTCFM (the "correct" manual case of an old favorite).

Thank you for your time,
Rhys Ulerich




More information about the Python-list mailing list