> I am trying to install PIL 1.7.7 on Mac OS X 10.6 running python 2.7.2
> I am getting the following error:
>> $ python setup.py build_ext -i
>> running build_ext
>> --- using frameworks at /System/Library/Frameworks
>> building '_imaging' extension
>> gcc-4.0 -fno-strict-aliasing -fno-common -dynamic -arch ppc -arch i386 -g -O2 -DNDEBUG -g -O3 -DHAVE_LIBJPEG -DHAVE_LIBZ -I/System/Library/Frameworks/Tcl.framework/Headers -I/System/Library/Frameworks/Tk.framework/Headers -IlibImaging -I/sw/include/freetype2 -I/sw/include -I/Library/Frameworks/Python.framework/Versions/2.7/include -I/usr/local/include -I/usr/include -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _imaging.c -o build/temp.macosx-10.3-fat-2.7/_imaging.o
>> unable to execute gcc-4.0: No such file or directory
>> error: command 'gcc-4.0' failed with exit status 1
> I think it is because I don't have Python's build support files "python-dev", "python-devel", or similar.
No, it's because you don't have gcc-4.0 or at least don't have it on your $PATH.
You need to have Apple's Developer Tools installed or build up a dev environment with MacPorts to do this.
On 9/16/11 3:23 PM, Bruce Johnson wrote:
> On Sep 14, 2011, at 7:45 PM, Isaac Feldman wrote:
>> I am trying to install PIL 1.7.7 on Mac OS X 10.6 running python 2.7.2
> No, it's because you don't have gcc-4.0 or at least don't have it on your $PATH.
> You need to have Apple's Developer Tools installed or build up a dev environment with MacPorts to do this.
> It's simplest to just install Apples dev tools:
Correct, though PIL requires some dependencies as well, so it's not that
simple. What is simple is to use Russel Owen's "unofficial" binaries:
> That is the build for the 32 bit PPC+Intel build of python from
> python.org. Unless you really need 64 bit, that's the one I recommend.
Alternatively, if you install MacPorts installing binary packages are as
sudo port install py27-pil
or, even better once you have virtualenv installed:
virtualenv-2.7 --no-site-packages mypythonfolder
bin/pip install pillow
For most Python users I'd suggest MacPorts is the way to go because it
handles necessary libraries and allows for uninstalling. Caveat is that
from Snow Leopard on the builds are generally x86_64 only.