在OSX 10.9中安装lxml

2024-04-25 22:08:54 发布

您现在位置:Python中文网/ 问答频道 /正文

在我的mavericks机器中安装lxml时遇到问题。在

我尝试了所有的可能性,通过使用

  • 正常pip
  • static deps的pip

和建筑

  • 正常型号的当前版本
  • 具有静态deps的当前版本
  • 正常模式下的旧版本
  • 带有静态deps的旧版本

总是以这个错误告终。在

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

这里有详细的信息

^{pr2}$

另外,当我尝试安装cython时,也遇到了相同的错误

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

此处显示详细日志

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 -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c /private/var/folders/1z/7lv1qq457qxbhkgpt1fk9sdc0000gn/T/pip_build_mangoreader/cython/Cython/Plex/Scanners.c -o build/temp.macosx-10.9-intel-2.7/private/var/folders/1z/7lv1qq457qxbhkgpt1fk9sdc0000gn/T/pip_build_mangoreader/cython/Cython/Plex/Scanners.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

----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/var/folders/1z/7lv1qq457qxbhkgpt1fk9sdc0000gn/T/pip_build_mangoreader/cython/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/1z/7lv1qq457qxbhkgpt1fk9sdc0000gn/T/pip-0akrMB-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/var/folders/1z/7lv1qq457qxbhkgpt1fk9sdc0000gn/T/pip_build_mangoreader/cython
Storing debug log for failure in /Users/mangoreader/Library/Logs/pip.log

我在这里被深深打动了。这似乎与gcc或libxml的版本冲突有关。但我不知道是什么。非常感谢你的帮助。在

已解决

根据这个SO post clang error: unknown argument: '-mno-fused-madd' (python package installation failure),可以通过设置以下env变量来解决这个问题

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

Tags: pipinvarfutureerrorbeargumentcommand