Showing posts with label pil. Show all posts
Showing posts with label pil. Show all posts

2010-08-11

Python Imaging Library: building from source

The Python Imaging Library (PIL) provides image processing capabilities to Python. If, like me, you need several versions of Python available, you will need to compile PIL from source.

If you run on a 64-bit version of Linux (I use Fedora 13), the locations of libraries are different from what PIL expects. So, you have to edit the setup.py file to point to the correct directories. Near the top of setup.py, put in:

    FREETYPE_ROOT = "/usr/lib64", "/usr/include"
    JPEG_ROOT = "/usr/lib64", "/usr/include"
    TIFF_ROOT = "/usr/lib64", "/usr/include"
    ZLIB_ROOT = "/usr/lib64", "/usr/include"
    TCL_ROOT = "/usr/lib64", "/usr/include"

If you had an unsuccessful build, you will need to remove the build directory before trying again.