tags:

views:

728

answers:

3

Hi. I'm an extremely amateur programmer; I've done some recreational algorithmics programming, but I honestly have no idea how libraries and programming languages really fit together. I'm supposed to work on a project that requires some image processing, so I've been trying to install PIL for a while, but I haven't been able to.

I went to http://www.pythonware.com/products/pil/ and downloaded "Python Imaging Library 1.1.6 Source Kit (all platforms) (440k TAR GZ) (December 3, 2006)". Then I opened the folder in my command prompt and ran

$ python setup.py build_ext -i .

This was the output I got:

running build_ext

--- using frameworks at /System/Library/Frameworks

building '_imaging' extension

gcc -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -Os -Wall -Wstrict-prototypes -DMACOSX -I/usr/include/ffi -DENABLE_DTRACE -arch i386 -arch ppc -pipe -DHAVE_LIBZ -IlibImaging -I/opt/local/include -I/System/Library/Frameworks/Python.framework/Versions/2.5/include -I/usr/local/include -I/usr/include -I/System/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -c _imaging.c -o build/temp.macosx-10.5-i386-2.5/_imaging.o

unable to execute gcc: No such file or directory

error: command 'gcc' failed with exit status 1

"import Image" produced an error when I tried it.

Do you guys have any idea what's going on? I'm using a MacBook Pro with a Core 2 Duo.

And I'm honestly sorry if this is ridiculously stupid.

A: 

GCC is the GNU compiler. It's a very useful thing to have. You just need to install it in whatever mac-friendly way exists.

http://www.tech-recipes.com/rx/726/mac-os-x-install-gcc-compiler/

SpliFF
+3  A: 

You need to install the developer tools that come on your Mac OS X install DVD.

albertb
+3  A: 

Actually, assuming you're still using the default 2.5.x Python that comes with OS X (at least as of 10.5.6), there's a pre-built installer package for it (download the dmg for PIL).

Otherwise, you'll need to either build it from source -- which does require the mac dev tools -- or install it with MacPorts or fink

edit: mono makes a good point, you'll still need the dev tools unless you use the pre-built installer.

EvanK
MacPorts will build from source and therefore requires installed devtools as well.
monowerker