当我尝试通过easy_install安装它时,我有centos 6.3和python 2.6我得到以下错误:
_imaging.c:76:20: error: Python.h: No such file or directory
In file included from /tmp/easy_install-HY7WI1/Pillow-2.3.0/libImaging/Imaging.h:14,
from _imaging.c:82:
/tmp/easy_install-HY7WI1/Pillow-2.3.0/libImaging/ImPlatform.h:14:2: error: #error Sorry, this library requires support for ANSI prototypes.
/tmp/easy_install-HY7WI1/Pillow-2.3.0/libImaging/ImPlatform.h:17:2: error: #error Sorry, this library requires ANSI header files.
/tmp/easy_install-HY7WI1/Pillow-2.3.0/libImaging/ImPlatform.h:55:2: error: #error Cannot find required 32-bit integer type
In file included from _imaging.c:82:
/tmp/easy_install-HY7WI1/Pillow-2.3.0/libImaging/Imaging.h:93: error: expected specifier-qualifier-list before ‘INT32’
/tmp/easy_install-HY7WI1/Pillow-2.3.0/libImaging/Imaging.h:400: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘ImagingCRC32’
......................
_imaging.c:3409: error: expected ‘)’ before ‘*’ token
error: Setup script exited with error: command 'gcc' failed with exit status 1
顺便说一句,我的gcc编译器是4.4.7,如果有帮助的话。
答案 0 :(得分:14)
您需要先安装python26-devel
才能编译任何 Python扩展。
要编译Pillow,您还需要为各种其他库安装开发标头,包括libjpeg-devel
和zlib-devel
。有关需要哪些外部库的详细信息,请参阅Pillow installation instructions。
答案 1 :(得分:9)
确保先运行:
sudo yum install python-devel libjpeg-devel zlib-devel
答案 2 :(得分:1)
对于那些来这里寻求当前解决方案的人(使用python 2.7.5的centos 7),你需要 python-devel.x86_64 而不是 python26-devel