【问题标题】:Challenge installing psd-tools on fresh Mac挑战在新 Mac 上安装 psd-tools
【发布时间】:2013-08-26 09:47:31
【问题描述】:

半年以来,我一直在使用 PSD-TOOLS 在 13 英寸笔记本上产生巨大影响(Python 2.7.3)。刚刚尝试在运行 10.8.4 的 Mac 上进行全新安装。

我在http://docs.python-guide.org/en/latest/starting/install/osx/(Python 版本

安装的 Pil 使用:

sudo pip install pil

我所有的 Pil 脚本都可以正常工作。

pip list 

显示 PIL (1.1.7) 安装正常。

然后尝试使用以下方法安装 psd-tools:

sudo pip install psd-tools

似乎可以正常安装,但是当我运行我的 PSD 脚本时,得到以下信息:

File "/Library/Python/2.7/site-packages/psd_tools/user_api/psd_image.py", line 91, in as_PIL
return self._psd._layer_as_PIL(self._index)
File "/Library/Python/2.7/site-packages/psd_tools/user_api/psd_image.py", line 243, in _layer_as_PIL
return pil_support.extract_layer_image(self.decoded_data, index)
File "/Library/Python/2.7/site-packages/psd_tools/user_api/pil_support.py", line 32, in extract_layer_image
decoded_data.header.depth, get_icc_profile(decoded_data))
File "/Library/Python/2.7/site-packages/psd_tools/user_api/pil_support.py", line 68, in _channels_data_to_PIL
raise Exception("This module requires PIL (or Pillow) installed.")
Exception: This module requires PIL (or Pillow) installed.

有人遇到过这个问题吗?

【问题讨论】:

    标签: python macos python-imaging-library pip


    【解决方案1】:

    我在OSX 10.9Python 2.7.5 上遇到了这个问题。 (在虚拟环境中)

    我最终检查了 https://pypi.python.org/pypi/Pillow/2.2.1 并为 Pillow 安装了一些可选的先决条件。

    #I already had libjpeg but this is the line in their doc.
    brew install libtiff libjpeg webp littlecms
    #Then re-installed Pillow
    pip install --force-reinstall --upgrade pillow
    

    结果是启用了以下功能

    --- TKINTER support available
    --- JPEG support available
    --- ZLIB (PNG/ZIP) support available
    --- TIFF G3/G4 (experimental) support available
    *** FREETYPE2 support not available
    --- LITTLECMS support available
    --- WEBP support available
    --- WEBPMUX support available
    

    我的小型 python 测试运行了

    from PIL import Image
    from psd_tools import PSDImage
    psd = PSDImage.load('test_data/1.psd')
    merged_image = psd.as_PIL()
    

    不确定这些要求中的哪一个是负责任的,所以如果您对安装额外的库不感兴趣,您可能必须一次做 1 个或深入研究源代码。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-12-18
      • 2014-12-22
      • 2014-05-04
      • 1970-01-01
      • 1970-01-01
      • 2014-05-15
      • 2014-02-07
      • 1970-01-01
      相关资源
      最近更新 更多