在Mac OS X El Capitan上安装枕头时出错:

时间:2016-05-01 15:09:32

标签: macos pip python-imaging-library pillow

在安装Pillow库时我遇到了这个错误,我无法解决。我该怎么办?

我执行了:

sudo pip install pillow

错误是:

File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/command/build_ext.py", line 337, in run

    self.build_extensions()

File "/private/var/folders/tj/cm2crntx36s3stmy1sytp_rh0000gn/T/pip_build_Joan/Pillow/setup.py", line 512, in build_extensions

    ' using --disable-%s, aborting' % (f, f))

ValueError: jpeg is required unless explicitly disabled using --disable-jpeg, aborting

----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/var/folders/tj/cm2crntx36s3stmy1sytp_rh0000gn/T/pip_build_Joan/Pillow/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/tj/cm2crntx36s3stmy1sytp_rh0000gn/T/pip-Q1zgvI-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/var/folders/tj/cm2crntx36s3stmy1sytp_rh0000gn/T/pip_build_Joan/Pillow
Storing debug log for failure in /var/folders/tj/cm2crntx36s3stmy1sytp_rh0000gn/T/tmpKTHfju

1 个答案:

答案 0 :(得分:1)

我安装了这个标志并且它可以工作,使用此选项不可能使用jpeg文件:

sudo pip install pillow --global-option="build_ext" --global-option="--disable-jpeg"