在CentOS 6.6上安装Pillow时出错

0 投票
1 回答
1305 浏览
提问于 2025-05-10 23:55

我这两天一直在尝试在 Cent OS 6.6 上安装 psycopg2Pillow 3.0,但是一直安装不成功,还出现了错误。

我查阅了 Stack Overflow 上的所有答案和一些博客,但都没有解决我的问题。

在安装 Pillow 时出现的错误信息是 (注意:我也尝试了 Stack Overflow 上所有可用的解决方案)

(first)[root@localhost ~]# pip install Pillow
Downloading/unpacking Pillow
  Downloading Pillow-3.0.0.tar.gz (9.6MB): 9.6MB downloaded
  Running setup.py egg_info for package Pillow
    Single threaded build, not installing mp_compile:1 processes

Installing collected packages: Pillow
  Running setup.py install for Pillow
    Single threaded build, not installing mp_compile:1 processes

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/root/.virtualenvs/first/build/Pillow/setup.py", line 767, in <module>
        zip_safe=not debug_build(),
      File "/usr/local/lib/python2.7/distutils/core.py", line 151, in setup
        dist.run_commands()
      File "/usr/local/lib/python2.7/distutils/dist.py", line 953, in run_commands
        self.run_command(cmd)
      File "/usr/local/lib/python2.7/distutils/dist.py", line 972, in run_command
        cmd_obj.run()
      File "/root/.virtualenvs/first/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/setuptools/command/install.py", line 56, in run
      File "/usr/local/lib/python2.7/distutils/command/install.py", line 563, in run
        self.run_command('build')
      File "/usr/local/lib/python2.7/distutils/cmd.py", line 326, in run_command
        self.distribution.run_command(command)
      File "/usr/local/lib/python2.7/distutils/dist.py", line 972, in run_command
        cmd_obj.run()
      File "/usr/local/lib/python2.7/distutils/command/build.py", line 127, in run
        self.run_command(cmd_name)
      File "/usr/local/lib/python2.7/distutils/cmd.py", line 326, in run_command
        self.distribution.run_command(command)
      File "/usr/local/lib/python2.7/distutils/dist.py", line 972, in run_command
        cmd_obj.run()
      File "/usr/local/lib/python2.7/distutils/command/build_ext.py", line 337, in run
        self.build_extensions()
      File "/root/.virtualenvs/first/build/Pillow/setup.py", line 515, in build_extensions
        % (f, f))
    ValueError: --enable-jpeg requested but jpeg not found, aborting.
    Complete output from command /root/.virtualenvs/first/bin/python2.7 -c "import setuptools;__file__='/root/.virtualenvs/first/build/Pillow/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-MaTP1u-record/install-record.txt --single-version-externally-managed --install-headers /root/.virtualenvs/first/include/site/python2.7:
    Single threaded build, not installing mp_compile:1 processes

running install

running build

running build_py

creating build

creating build/lib.linux-x86_64-2.7

creating build/lib.linux-x86_64-2.7/PIL

copying PIL/PSDraw.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/Hdf5StubImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/PcfFontFile.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/McIdasImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageTk.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageColor.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImagePath.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageMorph.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/PpmImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/JpegImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageStat.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/PngImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/PcdImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageGrab.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/MspImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/WalImageFile.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/_binary.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImagePalette.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageFont.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/GifImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/GribStubImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/TiffImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/FitsStubImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/BufrStubImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/SpiderImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/FpxImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/GdImageFile.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/Image.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageTransform.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/IcoImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/IptcImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/OleFileIO.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/WmfImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ContainerIO.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageFile.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/PsdImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/TarIO.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/XbmImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImtImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/FontFile.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/features.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageFilter.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/IcnsImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/TgaImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/_util.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageDraw2.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/GimpPaletteFile.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageWin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageShow.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/XVThumbImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ExifTags.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/__init__.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/PalmImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageSequence.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/PaletteFile.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/BdfFontFile.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/SunImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/TiffTags.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/CurImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/PcxImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/GimpGradientFile.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageMode.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/XpmImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageChops.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/Jpeg2KImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/PyAccess.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageCms.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageQt.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/EpsImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/MpoImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageEnhance.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageMath.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/FliImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/MpegImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/DcxImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/WebPImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/JpegPresets.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/BmpImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/GbrImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/MicImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/PdfImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageOps.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/SgiImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/PixarImagePlugin.py -> build/lib.linux-x86_64-2.7/PIL

copying PIL/ImageDraw.py -> build/lib.linux-x86_64-2.7/PIL

running egg_info

writing Pillow.egg-info/PKG-INFO

writing top-level names to Pillow.egg-info/top_level.txt

writing dependency_links to Pillow.egg-info/dependency_links.txt

warning: manifest_maker: standard file '-c' not found



reading manifest file 'Pillow.egg-info/SOURCES.txt'

reading manifest template 'MANIFEST.in'

writing manifest file 'Pillow.egg-info/SOURCES.txt'

copying PIL/OleFileIO-README.md -> build/lib.linux-x86_64-2.7/PIL

running build_ext

Traceback (most recent call last):

  File "<string>", line 1, in <module>

  File "/root/.virtualenvs/first/build/Pillow/setup.py", line 767, in <module>

    zip_safe=not debug_build(),

  File "/usr/local/lib/python2.7/distutils/core.py", line 151, in setup

    dist.run_commands()

  File "/usr/local/lib/python2.7/distutils/dist.py", line 953, in run_commands

    self.run_command(cmd)

  File "/usr/local/lib/python2.7/distutils/dist.py", line 972, in run_command

    cmd_obj.run()

  File "/root/.virtualenvs/first/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/setuptools/command/install.py", line 56, in run

  File "/usr/local/lib/python2.7/distutils/command/install.py", line 563, in run

    self.run_command('build')

  File "/usr/local/lib/python2.7/distutils/cmd.py", line 326, in run_command

    self.distribution.run_command(command)

  File "/usr/local/lib/python2.7/distutils/dist.py", line 972, in run_command

    cmd_obj.run()

  File "/usr/local/lib/python2.7/distutils/command/build.py", line 127, in run

    self.run_command(cmd_name)

  File "/usr/local/lib/python2.7/distutils/cmd.py", line 326, in run_command

    self.distribution.run_command(command)

  File "/usr/local/lib/python2.7/distutils/dist.py", line 972, in run_command

    cmd_obj.run()

  File "/usr/local/lib/python2.7/distutils/command/build_ext.py", line 337, in run

    self.build_extensions()

  File "/root/.virtualenvs/first/build/Pillow/setup.py", line 515, in build_extensions

    % (f, f))

ValueError: --enable-jpeg requested but jpeg not found, aborting.

----------------------------------------
Command /root/.virtualenvs/first/bin/python2.7 -c "import setuptools;__file__='/root/.virtualenvs/first/build/Pillow/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-MaTP1u-record/install-record.txt --single-version-externally-managed --install-headers /root/.virtualenvs/first/include/site/python2.7 failed with error code 1 in /root/.virtualenvs/first/build/Pillow
Storing complete log in /root/.pip/pip.log

注意:我已经安装了所有必要的包,包括 postgresql-develsetuptoolspython-devel。根环境使用的是 Python 2.6.6,而 virtualenv 使用的是 Python 2.7.10

请帮帮我。

相关文章:

  • 暂无相关问题
暂无标签

1 个回答

3

第一个错误(已经删除)明确表示找不到 pg_config 这个可执行文件。你需要把路径 /usr/pgsql-9.4/bin 加入到 PATH 环境变量中。

第二个错误是在安装 Pillow 时出现的,它失败了是因为你没有安装 libjpeg-develzlib-devel。安装这两个东西就可以了。


更多信息:

Pillow 3.0 在处理 zliblibjpeg 的方式上做了一些改变。这一点在 python-pillow/Pillow issue#1457 中有提到。

撰写回答