首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >用Mac小车安装枕头(10.9.1)

用Mac小车安装枕头(10.9.1)
EN

Stack Overflow用户
提问于 2014-02-18 22:55:18
回答 6查看 12.1K关注 0票数 6

我正在按照说明安装枕头:

代码语言:javascript
运行
复制
http://pillow.readthedocs.org/en/latest/installation.html#mac-os-x-installation

问题是我在使用python -c 'from PIL import Image时出错了。

代码语言:javascript
运行
复制
 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中尝试解决这个问题,如下所示:

  1. 使用brew安装Pillowhttps://github.com/Homebrew/homebrew-python
  2. 安装libjpeg并从源:restart-error/安装

但是,什么也不起作用。有没有办法在小牛身上安装枕头?我使用Python2.7:默认的Python解释器。

EN

回答 6

Stack Overflow用户

发布于 2014-03-28 17:40:50

我确认按照这些步骤,我可以用XCode 5在小牛10.9.2上安装枕头

1:

代码语言:javascript
运行
复制
brew install libtiff libjpeg webp littlecms

2:转到这里,https://pypi.python.org/pypi/Pillow/2.3.1下载压缩文件并解压缩它。

3:打开终端窗口,转到终点站的枕头-2.3.1文件夹。

4:这两行非常重要,因为它们将忽略枕头安装过程中的错误,如果没有这两行,安装就无法完成(我正在使用python 2.7,因此您可能需要更改您使用的任何版本):

代码语言:javascript
运行
复制
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:运行命令

代码语言:javascript
运行
复制
sudo python setup.py install

完成了!

票数 7
EN

Stack Overflow用户

发布于 2014-05-04 04:33:08

遵循以下步骤

  1. 更新qppstore上的xcode
  2. 打开终端类型:
    1. xcode-select --install
    2. su
    3. export CFLAGS=-Qunused-arguments
    4. export CPPFLAGS=-Qunused-arguments
    5. pip install pillow

票数 6
EN

Stack Overflow用户

发布于 2014-04-28 05:58:06

一位朋友告诉我如何解决这个问题:

  1. 苏秀-
  2. 导出CFLAGS=-q未用-参数
  3. pip安装映像
  4. python
  5. 从PIL导入图像

https://github.com/moskytw

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/21867277

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档