【问题标题】:Error installing pillow on Mac OS X El Capitan:在 Mac OS X El Capitan 上安装枕头时出错:
【发布时间】:2016-08-26 09:01:56
【问题描述】:

在安装 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

【问题讨论】:

    标签: macos pip python-imaging-library pillow


    【解决方案1】:

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

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

    【讨论】:

    • 这是否意味着您安装的枕头版本无法读取(或写入)JPG文件?这是相当有限的:-(
    • @MichielOvertoom 是的,意思是这样,但在我的情况下,我只使用 .png 这不是问题。
    猜你喜欢
    • 1970-01-01
    • 2016-04-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-01-25
    • 2016-12-15
    相关资源
    最近更新 更多