我正在按照指示安装Pillow:
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”,我通过谷歌搜索尝试解决该问题,如下所示:
- 使用
brew
安装Pillow
:https://github.com/Homebrew/homebrew-python - 安装libjpeg并从源代码安装:http://www.thetoryparty.com/2010/08/31/pil-on-snow-leopard-_jpeg_resync_to_restart-error/
python -c "from PIL import Image"
没有显示任何错误。 - newguy