Installing lxml OSX Mavericks 10.9.2

末鹿安然 提交于 2019-12-13 05:15:27

问题


I am trying to install lxml on 10.9.2 Mavericks and i used all the solutions mentioned here before but i seem to get a different error, the argument '-mno-fused-madd' is unknown, i believe it just triggered a warning back then, but now it throws an error here's the log

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/usr/include/libxml2 -I/Users/workspace/mybooktype/build/lxml/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

UPDATE 1 i was originally trying to install the django app booktype so following the instructions i tried first

pip install lxml --install-option="--with-xml2-config=/usr/local/Cellar/libxml2/2.8.0/bin/xml2-config"

回答1:


you should install or upgrade command line tool for xcode. please try command in terminal:

xcode-select --install



回答2:


So the problem had nothing to do with the C compiler, it was in the python version used on the machine, apparently there was a conflict in python versions, a new clean installation of python solved the problem, and the .bash_profile. then we used the original command

pip install lxml

and it was successfully installed



来源:https://stackoverflow.com/questions/22571199/installing-lxml-osx-mavericks-10-9-2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!