0

When trying to install PIL on mac osx I do sudo python setup.py install and get everything right but the following output. Has this happened to anyone before?

running build_ext
--- using frameworks at /System/Library/Frameworks
building '_imaging' extension
creating build/temp.macosx-10.6-universal-2.6
creating build/temp.macosx-10.6-universal-2.6/libImaging
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_LIBJPEG -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/local/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/tmp//ccltKqHA.out (No such file or directory)
error: command 'gcc-4.2' failed with exit status 1
locoboy
  • 38,002
  • 70
  • 184
  • 260

2 Answers2

0
  1. Install Homebrew
  2. brew install python mysql
  3. easy_install pip
  4. pip install virtualenv virtualenvwrapper
  5. echo "source /usr/local/bin/virtualenvwrapper.sh > /dev/null" >> ~/.bash_profile
  6. source ~/.bash_profile
  7. mkvirtualenv --no-site-packages <your env name>
  8. pip install django pillow
Glorfindel
  • 21,988
  • 13
  • 81
  • 109
Michael Samoylov
  • 2,933
  • 3
  • 25
  • 33
0

Two things. First, be sure to set your architecture, and second, use pillow instead of PIL since it's an actively maintained fork of PIL. i.e.

ARCHFLAGS="-arch i386 -arch x86_64" sudo pip install pillow

If you're environment is all mucked up from your first attempt, here are some suggestions on where to find and remove old PIL files.

Community
  • 1
  • 1
Spike
  • 5,040
  • 5
  • 32
  • 47