我想在Python 2.7中创建一个wordcloud(在OS X Yosemite中)。
我安装了包,但是当我执行时:
from PIL import Image
出现错误:
from PIL import _imaging as core
ImportError: dlopen(/Applications/anaconda/lib/python2.7/site-packages/PIL/_imaging.so, 2): Library not loaded: libjpeg.8.dylib
Referenced from: /Applications/anaconda/lib/python2.7/site-packages/PIL/_imaging.so
Reason: image not found
答案 0 :(得分:0)
请务必安装prerequisites。
OS X安装
我们以Python Wheels的形式为OS X提供二进制文件。或者,您可以使用XCode从soure编译Pillow。
安装外部库的最简单方法是通过Homebrew。安装Homebrew后,运行:
$ brew install libtiff libjpeg webp little-cms2
安装枕头:
$ pip install Pillow