2

Hi I'm trying to install the python image library at "www.pythonware.com/products/pil" and am getting a couple errors. See terminal below.

cfarm:Desktop christopherfarm$ cd Imaging-1.1.7
cfarm:Imaging-1.1.7 christopherfarm$ ls
BUILDME     Docs        PIL     Sane        _imaging.c  _imagingmath.c  decode.c    encode.c    outline.c   setup.py
CHANGES     Images      PIL.pth     Scripts     _imagingcms.c   _imagingtk.c    display.c   libImaging  path.c
CONTENTS    MANIFEST    README      Tk      _imagingft.c    build       doctest.py  map.c       selftest.py
cfarm:Imaging-1.1.7 christopherfarm$ sudo python setup.py install
running install
running build
running build_py
running build_ext
--- using frameworks at /System/Library/Frameworks
building '_imaging' extension
gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch ppc -arch x86_64 -pipe -DHAVE_LIBZ -I/System/Library/Frameworks/Tcl.framework/Headers -I/System/Library/Frameworks/Tk.framework/Headers -IlibImaging -I/opt/local/include -I/System/Library/Frameworks/Python.framework/Versions/2.6/include -I/usr/include -I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c _imaging.c -o build/temp.macosx-10.6-universal-2.6/_imaging.o
_imaging.c:3017: warning: initialization from incompatible pointer type
_imaging.c:3077: warning: initialization from incompatible pointer type
/usr/libexec/gcc/powerpc-apple-darwin10/4.2.1/as: assembler (/usr/bin/../libexec/gcc/darwin/ppc/as or /usr/bin/../local/libexec/gcc/darwin/ppc/as) for architecture ppc not installed
Installed assemblers are:
/usr/bin/../libexec/gcc/darwin/x86_64/as for architecture x86_64
/usr/bin/../libexec/gcc/darwin/i386/as for architecture i386
_imaging.c:3017: warning: initialization from incompatible pointer type
_imaging.c:3077: warning: initialization from incompatible pointer type
_imaging.c:3281: fatal error: error writing to -: Broken pipe
compilation terminated.
_imaging.c:3017: warning: initialization from incompatible pointer type
_imaging.c:3077: warning: initialization from incompatible pointer type
lipo: can't open input file: /var/folders/64/64XKmTbXF+mgCYEKEqHbJk+++TI/-Tmp-//cce5jySl.out (No such file or directory)
error: command 'gcc-4.2' failed with exit status 1
locoboy
  • 38,002
  • 70
  • 184
  • 260
  • 1
    What kind of computer and OS are you using? Can you not install with `pip` or `easy_install` for some reason? – aganders3 Jan 27 '12 at 18:04
  • 2
    See this question if you are on OS X Lion and/or if you have XCode 4: http://stackoverflow.com/questions/5256397/python-easy-install-fails-with-assembler-for-architecture-ppc-not-installed-on/5283514#5283514 – Tamás Jan 27 '12 at 18:07
  • @Tamás omg wtf. You are the bomb. I'm a pretty big noob at this, why does this work?? Please submit this as an answer so I can give you credit. – locoboy Jan 27 '12 at 18:32
  • @cfarm54: actually, I tried to submit it as an answer and SO converted it to a comment automatically because of being too trivial. Just upvote my answer for the linked question ;) – Tamás Jan 27 '12 at 20:22

3 Answers3

3

I highly recommend you install homebrew. They have a PIL formula, which you can install with:

brew install pil
Glorfindel
  • 21,988
  • 13
  • 81
  • 109
jterrace
  • 64,866
  • 22
  • 157
  • 202
  • problem with this is it's not in the right path where django can use it. Apparently it's in "Cellar" not in Python/2.6/site-packages/ where i think it needs to be – locoboy Jan 29 '12 at 20:16
  • so as a temporary fix I just did `ln -s Cellar/.../PIL /Library/Python/2.6/site-packages/PIL` but is there any other way? – locoboy Jan 29 '12 at 20:28
0

Try running with sudo.

sudo python setup.py install

Robert Peters
  • 3,814
  • 1
  • 17
  • 9
-1

PIL is trying to use "gcc-4.2" instead of "gcc" because that's what was used to build Python. Try this

sudo ln -s /usr/bin/gcc /usr/bin/gcc-4.2
sudo python setup.py install
fraca7
  • 1,178
  • 5
  • 11