Installing PIL in Mac OS

PIL(Python Imaging Library) is an image processing library for python.

In this post I will show you how to install PIL.

Requisites:

  1. Python should be already installed on the machine. To make sure, just type ‘python’ in terminal and see if its already there.
  2. Xcode should already be installed

I installed PIL using pip.

If you dont have pip, do the following. Open the terminal and type the following:

curl -O http://pypi.python.org/packages/source/p/pip/pip-0.7.2.tar.gz
tar xzf pip-0.7.2.tar.gz
cd pip-0.7.2
sudo /usr/bin/python setup.py install

This will install pip. Once pip is installed, you can install PIL by following steps.

First make sure you have lib jpeg install for JPEG handling. To do that,

curl -O http://www.ijg.org/files/jpegsrc.v8c.tar.gz
tar zxvf jpegsrc.v8c.tar.gz
cd  jpeg-8c/
./configure
make
sudo make install

Then install PIL using pip

sudo pip install PIL

 

References:

  1. Python for Mac OS
  2. Python Imaging Library (PIL)
Advertisements

2 responses to “Installing PIL in Mac OS

  1. where do i find pip? and when i typed sudo pip install PIL into terminal it said sudo pip install PIL
    sudo: pip: command not found.
    please respond

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s