2012-01-27 51 views
2

嗨,我試圖安裝在「www.pythonware.com/products/pil」蟒蛇圖像庫,我得到了幾個錯誤。見下面的終端。Python的圖像庫

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 
+1

你用什麼樣的電腦和操作系統?由於某些原因,你不能使用「pip」或「easy_install」進行安裝? – aganders3 2012-01-27 18:04:56

+2

看到這個問題,如果你在OS X的獅子和/或如果你有Xcode 4:http://stackoverflow.com/questions/5256397/python-easy-install-fails-with-assembler-for-architecture-ppc-未安裝的開/ 5283514#5283514 – 2012-01-27 18:07:52

+0

我在Mac – locoboy 2012-01-27 18:21:45

回答

3

我強烈建議你安裝homebrew。他們有一個PIL formula,您可以與安裝:

brew install pil 
+0

問題,這是它不是在Django中可以使用它在正確的道路。顯然,這是在「地窖」不是在Python/2.6 /站點包/在那裏我覺得它需要 – locoboy 2012-01-29 20:16:27

+0

這樣一個臨時的解決辦法我只是做了'LN -s /.../酒窖PIL /Library/Python/2.6/ site-packages/PIL',但還有其他方法嗎? – locoboy 2012-01-29 20:28:49

+0

這有幫助嗎? https://github.com/mxcl/homebrew/wiki/Homebrew-and-Python – jterrace 2012-01-29 21:37:04

0

嘗試使用sudo運行。

sudo的蟒蛇的setup.py安裝

+0

抱歉,這是不是 – locoboy 2012-01-27 18:21:28

-1

PIL試圖使用的「GCC-4.2」,而不是「海灣合作委員會」,因爲這是用來構建Python。試試這個

sudo ln -s /usr/bin/gcc /usr/bin/gcc-4.2 
sudo python setup.py install