Skip Navigation

Text Only/ Printer-Friendly

Carleton College

  • Home
  • Academics
  • Campus Life
  • Prospective Students
  • Alumni
  • Faculty & Staff
  • Students
  • Families

PIL (Python Imaging Library) for Python 2.x

PIL (aka the Python Imaging Library) is used in many of the Carleton College Intro CS courses. NOTE:  PIL is NOT available for Python 3.  This page contains installation instructions for Python 2.x:

WINDOWS XP and Vista and 7:

MAC:

  • In order to install PIL, you must have Xcode, a developer toolset, installed on your machine.  These files can be found on the installation CD's provided by Apple when you purchased your MAC.
  • These files can also be found online: http://developer.apple.com/technologies/xcode.html
  • You MUST be a registered Apple Developer to download software.  Registration is free and can be done here: http://developer.apple.com/programs/register/
  • PIL has not been packaged into a dmg, so we will need to use the Terminal for this, to open Terminal go to Applications>Utilities and find terminal.
  • Now if you have installed wget in the past you can type at the command prompt:
    • wget http://www.ijg.org/files/jpegsrc.v8c.tar.gz
  • At the command line type the following:
    • tar zxvf jpegsrc.v8c.tar.gz
      cd jpeg-8/
      ./configure
      make
      sudo make install
      • Note ./configure, make, and sudo make install may take some time

We've had the best luck installing PIL using a tool called pip, so first, you'll need to install pip.

  • At the command line, type the following:
    • curl -O http://python-distribute.org/distribute_setup.py
    • sudo python2.7 distribute_setup.py
    • curl -O https://raw.github.com/pypa/pip/master/contrib/get-pip.py
    • sudo python2.7 get-pip.py
  • Finally, type:
    • sudo pip-2.7 install pil
      • This will take a while.

If you have any questions about installing PIL for Windows, Mac, or any other operating system, please contact Michael Tie (mtie@carleton.edu x4067)

If you having trouble with a laptop, you can even bring your computer to Mike Tie (cmc 305) for help.