2010-05-05 151 views
2

我一直在努力爭取在Cygwin上安裝PIL。我收到的錯誤與我使用Google發現的常見錯誤不一致。也許Linux的大師可以看到在這個輸出一個明顯的問題:在Cygwin上安裝PIL

$ python setup.py install 
running install 
running build 
running build_py 
running build_ext 
building '_imaging' extension 
gcc -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DHAVE_LIBZ -I/usr/include/freetype2 -IlibImaging -I/usr/include -I/usr/include/python2.5 -c _imaging.c -o build/temp.cygwin-1.7.2-i686-2.5/_imaging.o 
In file included from /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/syslimits.h:7, 
       from /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/limits.h:11, 
       from /usr/include/python2.5/Python.h:18, 
       from _imaging.c:75: 
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/limits.h:122:61: limits.h: No such file or directory 
In file included from _imaging.c:75: 
/usr/include/python2.5/Python.h:32:19: stdio.h: No such file or directory 
/usr/include/python2.5/Python.h:34:5: #error "Python.h requires that stdio.h define NULL." 
/usr/include/python2.5/Python.h:37:20: string.h: No such file or directory 
/usr/include/python2.5/Python.h:39:19: errno.h: No such file or directory 
/usr/include/python2.5/Python.h:41:20: stdlib.h: No such file or directory 
/usr/include/python2.5/Python.h:43:20: unistd.h: No such file or directory 
/usr/include/python2.5/Python.h:55:20: assert.h: No such file or directory 
In file included from /usr/include/python2.5/Python.h:57, 
       from _imaging.c:75: 
/usr/include/python2.5/pyport.h:7:20: stdint.h: No such file or directory 
In file included from /usr/include/python2.5/Python.h:57, 
       from _imaging.c:75: 
/usr/include/python2.5/pyport.h:89: error: parse error before "Py_uintptr_t" 
/usr/include/python2.5/pyport.h:89: warning: type defaults to `int' in declaration of `Py_uintptr_t' 
/usr/include/python2.5/pyport.h:89: warning: data definition has no type or storage class 
/usr/include/python2.5/pyport.h:90: error: parse error before "Py_intptr_t" 
/usr/include/python2.5/pyport.h:90: warning: type defaults to `int' in declaration of `Py_intptr_t' 

...更多行這樣

回答

1

看起來你需要安裝GNU庫,因爲 syslimits.h; limits.h中; errno.h中; stdlib.h中; assert.h等都屬於它。

對於windows,您可以獲得二進制安裝程序;如果您不想在CYGWIN下創建PIL,您可以選擇其中的一種,http://www.pythonware.com/products/pil/#Downloads

+0

我已經安裝了libglib2.0-devel。我認爲這是GNU libC庫。但是,沒有運氣。 我更喜歡在cygwin中工作,而不是使用windows cmd工具,所以我真的想要安裝它。 – Dustin 2010-05-05 14:13:21

0

您可以下載新的cygwin二進制文件並在Python部分安裝圖像庫。這將使PIL可用於cygwin python 2.7。