安装枕头错误

时间:2014-05-28 18:14:02

标签: python django clang pip osx-mavericks

我正在尝试syncdb我克隆的新项目。在安装了这些要求后,我注意到我需要安装PIL或Pillow才能使syncdb工作。

以下是我运行pip install pillow时发生的事情:

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

在搜索堆栈后,我尝试执行以下命令:

export CFLAGS=-Qunused-arguments
export CPPFLAGS=-Qunused-arguments
sudo -E pip install pillow

最终得到了:

In file included from _imagingtk.c:19:

    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/tk.h:78:11: fatal error: 'X11/Xlib.h' file not found

    #       include <X11/Xlib.h>

                    ^

    1 error generated.

    error: command 'cc' failed with exit status 1

至少没有铿锵声,但枕头仍无法奏效。我尝试过其他一些方法,包括忽略旗帜和诸如此类的东西,但它们似乎都没有让枕头在我的virtualenv中工作。任何想法我能做什么?我正在运行小牛10.9.2

2 个答案:

答案 0 :(得分:2)

我正在使用OS X El Capitan,这对我有用。

  1. 关闭您的virtualenv活动终端窗口。
  2. 打开新终端并运行sudo xcode-select --install,需要一些时间才能完成。
  3. 完成后打开一个新终端并运行pip install Pillow

答案 1 :(得分:1)

你的Mac上安装了Homebrew吗?如果这样做,Pillow文档建议您使用以下命令进行安装:

brew install libtiff libjpeg webp little-cms2

有关详细信息,请参阅http://pillow.readthedocs.org/en/latest/installation.html#os-x-installation

同样,如果你有自制软件,你也可以看一下homebrew-python,它为枕头提供了酿造配方。