簡體   English   中英

為什么我不能為python安裝lxml?

[英]Why can't I install lxml for python?

我已經下載了lxml的tarball,並正在使用ipython setup.py install嘗試安裝它。 不幸的是,它給了我很多錯誤消息:

src/lxml/lxml.etree.c:200651: error: ‘XML_XPATH_INVALID_OPERAND’ undeclared (first use in this function)
src/lxml/lxml.etree.c:200661: error: ‘XML_XPATH_INVALID_TYPE’ undeclared (first use in this function)
src/lxml/lxml.etree.c:200671: error: ‘XML_XPATH_INVALID_ARITY’ undeclared (first use in this function)
src/lxml/lxml.etree.c:200681: error: ‘XML_XPATH_INVALID_CTXT_SIZE’ undeclared (first use in this function)
src/lxml/lxml.etree.c:200691: error: ‘XML_XPATH_INVALID_CTXT_POSITION’ undeclared (first use in this function)
src/lxml/lxml.etree.c:200921: error: ‘LIBXSLT_VERSION’ undeclared (first use in this function)
src/lxml/lxml.etree.c:200933: error: ‘xsltLibxsltVersion’ undeclared (first use in this function)
src/lxml/lxml.etree.c:200945: error: ‘__pyx_v_4lxml_5etree_XSLT_DOC_DEFAULT_LOADER’ undeclared (first use in this function)
src/lxml/lxml.etree.c:200945: error: ‘xsltDocDefaultLoader’ undeclared (first use in this function)
src/lxml/lxml.etree.c:200954: error: ‘xsltDocLoaderFunc’ undeclared (first use in this function)
src/lxml/lxml.etree.c:200954: error: expected ‘)’ before ‘__pyx_f_4lxml_5etree__xslt_doc_loader’
An exception has occurred, use %tb to see the full traceback.

SystemExit: error: command 'gcc' failed with exit status 1

有人知道這是怎么回事嗎? 顯然,cython會干擾安裝,但是我的系統上沒有安裝cython。 這是在centos 6.4操作系統上,ipython運行2.7。

lxml依賴於libxml2libxslt 使用yum安裝開發頭文件:

yum install libxml2-devel libxslt-devel python-devel

暫無
暫無

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

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