【问题标题】:Installing Pillow/PIL on Mavericks在 Mavericks 上安装 Pillow/PIL
【发布时间】:2014-04-15 14:22:45
【问题描述】:

我在尝试使用 pip/easy_install 安装 Pillow 时遇到一个奇怪的错误:

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.3/include/freetype2 -I/private/var/folders/c_/r7sp373509jdb6_1xmmzvl9c0000gn/T/pip_build_tills13/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: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]

clang: note: this will be a hard error (cannot be downgraded to a warning) in the future

error: command 'cc' failed with exit status 1

我已经阅读了所有符号链接的答案,我已经安装了命令行工具,但似乎没有任何效果。我总是遇到这个错误。

【问题讨论】:

  • @patsweet 我经过那里并尝试了所有的 cmets。 xcode-select --install 甚至对我都不起作用 - “软件无法从更新服务器获得”
  • 你考虑过使用 MacPorts 吗?
  • 很奇怪。您的路径设置是否包含命令行工具?另外,你是如何安装 Python 的。我刚刚安装了一台新的 MacBook Pro,并使用 Homebrew 安装了 Python 和其他各种工具,我强烈推荐它。
  • @patsweet 是的,我使用 Homebrew。我从 Apple 的开发者网站手动安装了命令行工具:developer.apple.com/downloads/…

标签: python python-imaging-library pip easy-install pillow


【解决方案1】:

我通过以下方式解决了这个问题。可能与今天的 Mavericks 命令行工具更新有关。在执行 pip install 之前尝试将以下内容添加到终端:

export CFLAGS=-Qunused-arguments
export CPPFLAGS=-Qunused-arguments

【讨论】:

  • 这也解决了我的问题!泰勒,回来把这个答案标记为正确。我在 10.8.5(修复 goto 失败错误的最新 OSX 更新),遇到了同样的问题。有谁知道真正的问题是什么?
  • 我有这个问题太久了,解决了!谢谢你:) 请注意,我必须安装它: pip install PIL --allow-external PIL --allow-unverified PIL
  • 这对我在小牛队有用。我花了一段时间才到这里。我的 linux 服务器在安装它时甚至没有眨眼。
【解决方案2】:

除了@jussi,我还必须打开终端并执行以下操作:

    sudo bash
    export CFLAGS=-Qunused-arguments
    export CPPFLAGS=-Qunused-arguments

只有这样才能正确运行'pip install枕头'

如果我没有使用超级用户提示运行它,我会收到以下错误:

    error: could not create '/Library/Python/2.7/site-packages/PIL': Permission denied

我正在运行安装了 2014 年 3 月命令行工具的 OSX 10.9.2。如果有什么不同,我也安装了 Homebrew。

【讨论】:

  • 安装到系统python时只需要sudo,使用virtualenv时不需要。
  • 2 天的搜索,这个小小的花絮解决了这个确切的问题。
【解决方案3】:

查看 brew http://brew.sh

brew tap Homebrew/python
brew install pillow

【讨论】:

    【解决方案4】:

    这些解决方案都不适合我。我终于在this post的帮助下安装了它:

    我在尝试使用最新的 Xcode 和操作系统更新构建 MySQLdb 时发现了同样的问题。这是一个涉及从 python 安装中删除标志的解决方法。

    在 /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_sysconfigdata.py 中有几个地方设置了 -mno-fused-madd 标志。如果您编辑此文件并删除对该标志的所有引用,您的编译应该可以工作。您还需要删除相应的 _sysconfigdata.pyc 文件 - 至少在我的系统上,该文件没有自动重建。请注意,必须使用 root 访问权限才能进行这些更改。

    【讨论】:

      【解决方案5】:

      在终端中运行这个命令:

      ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip install pillow


      更多信息:

      Xcode 5.1 附带的编译器将未知的传递参数视为错误。

      我们告诉它忽略那些“错误”

      来源:http://bruteforce.gr/bypassing-clang-error-unknown-argument.html

      【讨论】:

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