![](/img/trans.png)
[英]Install Pillow for Python 3.4 on Mac Os X Mavericks (10.9)
[英]Installing Pillow with Mac OS X Mavericks (10.9.1)
我正在尝试按照说明安装 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
is not found,我用_jpeg_resync_to_restart
搜索尝试解决这个问题,如下所示:
brew
安装Pillow
: https : //github.com/Homebrew/homebrew-python但是,没有任何效果。 有没有办法在小牛队上安装枕头? 我使用 Python 2.7:默认的 Python 解释器。
我确认按照这些步骤我可以使用 XCode 5 在 Mavericks 10.9.2 上安装 Pillow
1:
brew install libtiff libjpeg webp littlecms
2:到这里https://pypi.python.org/pypi/Pillow/2.3.1
下载 zip 文件并解压。
3:打开终端窗口并转到终端中的 Pillow-2.3.1 文件夹。
4:这两行非常重要,因为它们会忽略Pillow安装过程中的错误,没有这两行就无法完成设置(我使用的是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.pyc
5:运行命令
sudo python setup.py install
完毕!
按着这些次序
xcode-select --install
su
export CFLAGS=-Qunused-arguments
export CPPFLAGS=-Qunused-arguments
pip install pillow
一个朋友告诉我如何解决这个问题:
在 2015 年 11 月遇到了这个问题。对我来说,最简单的解决方案是使用轮子安装枕头的预编译二进制文件:
pip install wheel
pip install --use-wheel pillow
安装命令行工具:
在小牛队为我工作
安装早期版本的 Pillow 对我有用
pip uninstall pillow
pip install Pillow==2.5.0
Boom Ya Baby!
from PIL import Image
运行 MacOSX 10.8.5 现在不会引发错误。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.