【问题标题】:Can't install Pillow on centos无法在 centos 上安装 Pillow
【发布时间】:2014-01-06 08:07:51
【问题描述】:

当我尝试通过 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,如果有帮助的话。

【问题讨论】:

    标签: python setuptools python-2.6 pillow


    【解决方案1】:

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

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

    【讨论】:

      【解决方案2】:

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

      【讨论】:

      • 我也必须这样做sudo yum install gcc
      【解决方案3】:

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

      【讨论】:

        猜你喜欢
        • 2016-02-26
        • 2022-08-15
        • 2015-02-02
        • 2013-10-18
        • 2014-01-20
        • 1970-01-01
        • 1970-01-01
        • 2017-06-10
        • 1970-01-01
        相关资源
        最近更新 更多