2012-04-27 98 views
0

我無法在我的Centos 5.8 x64上安裝PIL。 我試圖用pip install PIL命令來安裝它。但它遇到了gcc錯誤。 請參見下面的錯誤片段:無法在Centos 5.8中安裝最新版本的PIL

_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 

如果蟒蛇-devel的,libjpg和libpng已安裝是的,它們被安裝(如在一些環節我讀過可能的解決方案提到的)我已經選中。但是,錯誤仍然存​​在。

有關如何解決此問題的任何想法?提前致謝!

+0

安裝PIL你有什麼版本的gcc解決了嗎? – Denis 2012-04-27 07:32:05

+0

這是4.1.2 Dennis – jaysonpryde 2012-04-27 07:57:16

+0

嘗試更新到4.6.1 – Denis 2012-04-27 11:13:56

回答

1

您好,我有同樣的問題時,首先安裝此

yum install gcc 

現在你可以用

pip install PIL