【问题标题】:how to install PIL on Macosx 10.9?如何在 Macosx 10.9 上安装 PIL?
【发布时间】:2014-04-22 08:37:38
【问题描述】:

当我尝试在 Macosx 10.9.2 上安装 PIL 库时,出现以下错误,如何安装。

$: sudo pip 安装枕头

cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -DHAVE_LIBJPEG -DHAVE_LIBZ -DHAVE_LIBTIFF -I/System /Library/Frameworks/Tcl.framework/Versions/8.5/Headers -I/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -I/usr/local/Cellar/freetype/2.5.2/include/freetype2 -I/private/tmp/pip_build_root/pillow/libImaging -I/System/Library/Frameworks/Python.framework/Versions/2.7/include -I/usr/local/include -I/usr/include -I/System/Library /Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _imaging.c -o build/temp.macosx-10.9-intel-2.7/_imaging.o

clang:错误:未知参数:'-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]

clang:注意:这将是未来的硬错误(不能降级为警告)

错误:命令“cc”失败,退出状态为 1

【问题讨论】:

标签: python macos python-imaging-library


【解决方案1】:

以下路线帮助了我。

sudo ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip install枕头

【讨论】:

    【解决方案2】:

    这是因为 OS10.9 改变了它的 cc 编译器,所以 'cc' 不能编译一些 python 库。 我试图通过用旧版本的 gcc 替换我的 cc 编译器来解决这个问题。 首先,你应该安装 brew。

    $ ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
    

    并安装 gcc-4.2

    $ sudo brew install apple-gcc42
    

    删除当前抄送。它只是一个来自 clang 的符号链接,所以你不需要备份它。

    $ sudo rm -f /usr/bin/cc
    

    创建新的符号链接,cc -> gcc-4.2

    $ sudo ln -s /usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/gcc-4.2 /usr/bin/cc
    

    测试你是否更改成功。

    $ ls -l /usr/bin | grep cc
    

    如果显示

    $ cc -> /usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/gcc-4.2
    

    这意味着您成功更改了 cc 编译器。你可以像 PIL 或枕头一样安装你的 python 库。

    【讨论】:

      猜你喜欢
      • 2013-11-01
      • 1970-01-01
      • 2013-11-30
      • 1970-01-01
      • 2023-01-24
      • 1970-01-01
      • 1970-01-01
      • 2021-01-03
      • 1970-01-01
      相关资源
      最近更新 更多