martes, 12 de febrero de 2013

How to install PIL on mac os x 10.7.2 Lion

you can just download/build/install it from source:

# download
curl -O -L
# extract
tar -xzf Imaging-1.1.7.tar.gz cd Imaging-1.1.7
# build and install
python build
sudo python install
# or install it for just you without requiring admin permissions:
# python install --user

I ran the above just now (on OSX 10.7.2, with XCode 4.2.1 and System Python 2.7.1) and it built just fine, though there is a possibility that something in my environment is non-default.

For those having trouble with gcc or llvm-gcc command not found error when running, check in xcode that commande line tools are installed by going to "Xcode -> Préférences -> Downloads -> Commande Line Tools -> Install".


If you use homebrew, you can install the PIL with just brew install pil. You may then need to add the install directory ($(brew --prefix)/lib/python2.7/site-packages) to your PYTHONPATH, or add the location of PIL directory itself in a file called PIL.pth file in any of your site-packages directories, with the contents:
(assuming brew --prefix is /usr/local).


No hay comentarios:

Publicar un comentario