簡體   English   中英

在OSX 10.9中安裝lxml

[英]installing lxml in OSX 10.9

我在我的小牛機器上安裝lxml遇到問題。

我通過使用安裝prebuild二進制文件嘗試了所有可能性

  • 正常的點子
  • pip with static 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

這里有詳細的信息

copying /Users/mangoreader/work/lxml-3.3.4/build/tmp/libxml2/include/libxslt/xsltutils.h -> build/lib.macosx-10.9-intel-2.7/lxml/includes/libxslt
running build_ext
building 'lxml.etree' extension
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/Users/mangoreader/work/lxml-3.3.4/build/tmp/libxml2/include -I/Users/mangoreader/work/lxml-3.3.4/build/tmp/libxml2/include/libxml2 -I/Users/mangoreader/work/lxml-3.3.4/build/tmp/libxml2/include/libxslt -I/Users/mangoreader/work/lxml-3.3.4/build/tmp/libxml2/include/libexslt -I/Users/mangoreader/work/lxml-3.3.4/src/lxml/includes -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/lxml/lxml.etree.c -o build/temp.macosx-10.9-intel-2.7/src/lxml/lxml.etree.o -w -flat_namespace
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

此外,當我嘗試安裝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錯誤:未知參數:'-mno-fused-madd'(python包安裝失敗) ,這可以通過設置以下env變量來修復

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

我確信你已將它整理出來,但萬一其他人需要它,安裝XCode和命令行工具,然后運行

pip install lxml

它會工作,可能需要一點時間。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM