Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/310.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
为什么我不能为python安装lxml?_Python_Lxml - Fatal编程技术网

为什么我不能为python安装lxml?

为什么我不能为python安装lxml?,python,lxml,Python,Lxml,我已经下载了lxml的tarball,我正在使用ipython setup.py安装来尝试安装它。不幸的是,它给了我很多错误信息: 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

我已经下载了lxml的tarball,我正在使用ipython setup.py安装来尝试安装它。不幸的是,它给了我很多错误信息:

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依赖于libxml2和libxslt。使用yum安装开发标头:

yum install libxml2-devel libxslt-devel python-devel
lxml依赖于libxml2和libxslt。使用yum安装开发标头:

yum install libxml2-devel libxslt-devel python-devel

你有python头开发安装吗?你有python头开发安装吗?