无法在Centos 5.8中安装最新版本的PIL

时间:2012-04-27 05:44:38

标签: python python-imaging-library

我无法在Centos 5.8 x64上安装PIL。   我尝试使用pip install PIL命令安装它。但它遇到了gcc错误。   请参阅以下错误代码段:

_imagingft.c:475: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token

_imagingft.c:502: error: old-style parameter declarations in prototyped function definition

/usr/include/freetype2/freetype/freetype.h:1574: error: parameter name omitted

_imagingft.c:502: error: expected ‘{’ at end of input

error: command 'gcc' failed with exit status 1

----------------------------------------
Command /usr/local/bin/python -c "import setuptools;__file__='/home/acresearch/downloads/py-modules/PIL/build/PIL/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-tHfjOz-record/install-record.txt failed with error code 1 in /home/acresearch/downloads/py-modules/PIL/build/PIL
Storing complete log in /root/.pip/pip.log

我已经检查过是否已经安装了python-devel,libjpg和libpng(在我读过的某些链接上提到了可能的分辨率),是的,它们已经安装好了。但是,错误仍然存​​在。

有关如何解决此问题的任何想法?提前谢谢!

1 个答案:

答案 0 :(得分:1)

你好,我有同样的问题,首先安装这个

解决了
yum install gcc

现在您可以使用

安装PIL
pip install PIL