我正在按照说明安装枕头:
http://pillow.readthedocs.org/en/latest/installation.html#mac-os-x-installation问题是我在使用python -c 'from PIL import Image时出错了。
python -c "from PIL import Image"
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Library/Python/2.7/site-packages/PIL/Image.py", line 53, in <module>
from PIL import _imaging as core
ImportError: dlopen(/Library/Python/2.7/site-packages/PIL/_imaging.so, 2):
Symbol not found: _jpeg_resync_to_restart
Referenced from: /Library/Python/2.7/site-packages/PIL/_imaging.so
Expected in: flat namespace
in /Library/Python/2.7/site-packages/PIL/_imaging.so消息说没有找到_jpeg_resync_to_restart,我在googled中尝试解决这个问题,如下所示:
brew安装Pillow:https://github.com/Homebrew/homebrew-python但是,什么也不起作用。有没有办法在小牛身上安装枕头?我使用Python2.7:默认的Python解释器。
发布于 2014-03-28 17:40:50
我确认按照这些步骤,我可以用XCode 5在小牛10.9.2上安装枕头
1:
brew install libtiff libjpeg webp littlecms2:转到这里,https://pypi.python.org/pypi/Pillow/2.3.1下载压缩文件并解压缩它。
3:打开终端窗口,转到终点站的枕头-2.3.1文件夹。
4:这两行非常重要,因为它们将忽略枕头安装过程中的错误,如果没有这两行,安装就无法完成(我正在使用python 2.7,因此您可能需要更改您使用的任何版本):
sudo sed -i '' -e 's/-mno-fused-madd//g' /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_sysconfigdata.py
sudo rm /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_sysconfigdata.pyc5:运行命令
sudo python setup.py install完成了!
发布于 2014-05-04 04:33:08
遵循以下步骤
xcode-select --installsuexport CFLAGS=-Qunused-argumentsexport CPPFLAGS=-Qunused-argumentspip install pillow
发布于 2014-04-28 05:58:06
https://stackoverflow.com/questions/21867277
复制相似问题