pip install lxml 出错,怎么解决? - V2EX
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
kchum

pip install lxml 出错,怎么解决?

  •  
  •   kchum Mar 21, 2014 7366 views
    This topic created in 4419 days ago, the information mentioned may be changed or developed.
    Mac os x 10.9.2

    提示错误如下:
    creating build/temp.macosx-10.9-intel-2.7/src

    creating build/temp.macosx-10.9-intel-2.7/src/lxml

    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/private/var/folders/22/f2h4btc90jncdy3p1sq_td0m0000gn/T/pip_build_KentChum/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

    搜索过,安装了command line tool,也export cc='gcc'了,没用。
    代码安装python setup.py,或者brew install lxml都是这个错误
    Supplement 1    Mar 21, 2014
    env ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip install lxml -i http://pypi.v2ex.com/simple

    即可安装,确实最近update了Xcode.
    7 replies    1970-01-01 08:00:00 +08:00
    binux
        2
    binux  
       Mar 21, 2014   1
    brew
    kchum
        3
    kchum  
    OP
       Mar 21, 2014
    @heqing 在lxml源代码目录的setup.cfg加入了[build_ext] compiler=icc,命令运行
    sudo python setup.py build --static-deps --libxml2-version=2.9.1 --libxslt-version=1.1.28
    同样出现
    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


    @binux 我是用brew install libxml2 libxslt了,上面有笔误。不知道你所说的是什么意思,麻烦指点下,谢谢。
    rockhead
        5
    rockhead  
       Mar 21, 2014   1
    给Xcode设置环境变量:
    ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future

    新版的xcode 检查更严格了,没有使用的命令行参数会当成错误处理
    rockhead
        6
    rockhead  
       Mar 21, 2014   1
    单行命令如下:

    env ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip install lxml
    kchum
        7
    kchum  
    OP
       Mar 21, 2014
    @heqing
    @binux
    @rockhead 感谢大家,如 @rockhead 所写的一样,已安装上。
    我这Cannot fetch index base URL https://pypi.python.org/simple/
    所以用v2的源
    env ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip install lxml -i http://pypi.v2ex.com/simple
    About     Help     Advertise     Blog     API     FAQ     Solana     6183 Online   Highest 6679       Select Laguage
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 55ms UTC 06:19 PVG 14:19 LAX 23:19 JFK 02:19
    Do have faith in what you're doing.
    ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86