I had a similar problem and the following solution worked for me, so I decided that I would publish it. Hope this helps someone else when they try out numerous solutions.
Firstly, I think some of the solutions here will work as well, and I used some of the above solutions as a spring board for my own.
[My setting]
I run in my virtual development environment.
Mac OS X 10.7
Pip
Django 1.3.1
Xcode 4.2.1
I found that freetype2 is already included in your Mac OS X installation in / usr / X11 / include
I'm not sure if it is installed with Xcode or just comes by default, but from what I read and understood there are some problems with patents that expired in 2010, so Apple does not include a โfont libraryโ by default.
I installed libjpeg earlier to install PIL using HomeBrew.
$ brew install libjpeg
First I installed PIL using pip, but later uninstalled it and decided to install Pillow instead
Believe me or not, it just worked for me.
$ pip install Pillow
Pillow seems to do the hairy job for you, linking and including the source from / usr / X 11 / lib, as shown in the output of the installation procedure below:
Starting setup.py installation for cushion --- using frameworks in / System / Library / Frameworks building up '_imaging' llvm-gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall - Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_TR -arch i386 -arch x86_64 -pipe -DHAVE_LIBJPEG -DHAVE_LIBZ -I / System / Library / Frameworks / Tcl. framework / Headers -I / System / Library / Frameworks / Tk.framework / Headers -I / usr / x11 / include / freetype2 -IlibImaging -I / opt / local / include -I / usr / x11 / include -I / Users / /. virtualenvs / canoe_django_env / include -I / usr / local / include -I / usr / include -I / System / Library / Frameworks / Python.framework / Versions / 2.7 / include / python2.7 -c _imaging.c -o build / temp.macosx-10.7-intel-2.7 / _imaging.o
I hope this helps as it worked for me. Sincerely.
source share