Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/316.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 在Mavericks上安装枕头/PIL_Python_Python Imaging Library_Pip_Easy Install_Pillow - Fatal编程技术网

Python 在Mavericks上安装枕头/PIL

Python 在Mavericks上安装枕头/PIL,python,python-imaging-library,pip,easy-install,pillow,Python,Python Imaging Library,Pip,Easy Install,Pillow,尝试使用pip/easy\u安装枕头时,我遇到一个奇怪的错误: 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

尝试使用pip/easy\u安装枕头时,我遇到一个奇怪的错误:

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

我已经阅读了所有符号链接的答案,我已经安装了命令行工具,但似乎什么都不起作用。我总是会犯这个错误。

我用下面的方法解决了这个问题。Propable与今天的Mavericks命令行工具更新有关。在执行pip安装之前,尝试将以下内容添加到终端:

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

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

    sudo bash
    export CFLAGS=-Qunused-arguments
    export CPPFLAGS=-Qunused-arguments
只有这样才能正确运行“pip安装枕头”

如果我没有使用超级用户提示运行此操作,则会出现以下错误:

    error: could not create '/Library/Python/2.7/site-packages/PIL': Permission denied
我正在运行OSX 10.9.2,安装了2014年3月的命令行工具。如果有什么不同,我也安装了自制软件。

查看brew


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

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

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


在终端中运行此命令:

ARCHFLAGS=-Wno error=未来pip安装中未使用的命令行参数硬错误


更多信息: Xcode 5.1附带的编译器将未知的传递参数视为错误

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


来源:

可能重复@patsweet,我在那里查看并尝试了所有评论
xcode-select--install
对我根本不起作用-“更新服务器上没有可用的软件”你考虑过使用MacPorts吗?奇怪。路径设置是否包括命令行工具?另外,如何安装Python。我刚刚安装了一台新的MacBook Pro,并使用自制软件来安装Python和其他各种工具,我强烈推荐它。@patsweet是的,我使用自制软件。我在苹果的开发者网站上手动安装了命令行工具:在安装到系统python时只需要sudo,而在使用virtualenv时不需要sudo。2天的搜索和这个小小的tidbid解决了这个问题。这也解决了我的问题!泰勒,回来把这个答案标记为正确。我使用的是10.8.5(最新的OSX更新修复了goto fail bug),遇到了同样的问题。有人知道真正的问题是什么吗?我有这个问题太久了,这就解决了它!谢谢:)注意,我必须安装它:pip install PIL——允许外部PIL——允许未验证的PIL这对我来说在Mavericks上很有效。我花了一段时间才到这里。我的linux服务器在安装这个时连眨眼都没眨一下。谢谢,对我有用,解决了这个问题
brew tap Homebrew/python
brew install pillow