7

当我尝试通过 easyinstall 安装它时,我有 cenots 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,如果有帮助的话。

4

3 回答 3

15

您需要先安装python26-devel,然后才能编译任何Python 扩展。

要编译 Pillow,您还需要安装各种其他库的开发头文件,包括libjpeg-develzlib-devel. 有关需要哪些外部库的更多详细信息,请参阅Pillow 安装说明

于 2014-01-06T08:18:17.370 回答
9

确保首先运行:
sudo yum install python-devel libjpeg-devel zlib-devel

于 2016-01-22T21:38:52.247 回答
1

对于来这里寻求当前解决方案的任何人(带有 python 2.7.5 的 centos 7),您将需要python-devel.x86_64而不是python26-devel

于 2016-01-07T00:49:00.293 回答