简体   繁体   English

不能在centos上安装Pillow

[英]Can't install Pillow on centos

I have cenots 6.3 and python 2.6 on it when I try to install it via easyinstall I get following error: 当我尝试通过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

by the way, my gcc compiler is 4.4.7, if that helps. 顺便说一句,我的gcc编译器是4.4.7,如果这有帮助的话。

You need to install python26-devel before you can compile any Python extension. 在编译任何 Python扩展之前,您需要安装python26-devel

To compile Pillow, you'll also need to install the development headers for various other libraries, including libjpeg-devel and zlib-devel . 要编译Pillow,您还需要为各种其他库安装开发头文件,包括libjpeg-develzlib-devel See the Pillow installation instructions for more details on what external libraries are needed. 有关所需外部库的更多详细信息,请参阅Pillow安装说明

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

对于那些来到这里获得当前解决方案的人(使用python 2.7.5的centos 7),你将需要python-devel.x86_64而不是python26-devel

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM