简体   繁体   English

建立'lxml.etree'扩展名时出错

[英]Error building 'lxml.etree' extension

I'm trying to install lxml, on an Ubuntu server running Python 2.6 (in a virtualenv - the system Python is 2.5). 我正在尝试在运行Python 2.6的Ubuntu服务器上安装lxml(在virtualenv中-系统Python是2.5)。

I've checked out via svn and as a result I've also install Cython, as per the instructions . 我已经通过svn签出了,因此,我还按照说明安装了Cython。

However, I get the following error when running python setup.py build : 但是,运行python setup.py build时出现以下错误:

Building lxml version 2.3.alpha1-76211.
Building with Cython 0.11.
Using build configuration of libxslt 1.1.22
Building against libxml2/libxslt in the following directory: /usr/lib
running build
running build_py
running build_ext
cythoning src/lxml/lxml.etree.pyx to src/lxml/lxml.etree.c

Error converting Pyrex file to C:
------------------------------------------------------------
...
        c_child = _findChildForwards(c_node, 0)
        while c_child is not NULL:
            if c_child.type == tree.XML_ELEMENT_NODE:
                for i in range(c_tag_count):
                    if _tagMatchesExactly(c_child, c_ns_tags[2*i], c_ns_tags[2*i+1]):
                        c_next = _findChildForwards(c_child, 0) or _nextElement(c_child)
                                                               ^
------------------------------------------------------------

/home/admin/web/blink/lxml/src/lxml/cleanup.pxi:246:64: Cannot assign type 'int' to 'xmlNode *'

Error converting Pyrex file to C:


building 'lxml.etree' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/include/libxml2 -I/home/admin/python/2.6.5/include/python2.6 -c src/lxml/lxml.etree.c -o build/temp.linux-x86_64-2.6/src/lxml/lxml.etree.o -w
src/lxml/lxml.etree.c:1:2: error: #error Do not use this file, it is the result of a failed Cython compilation.
error: command 'gcc' failed with exit status 1

And very similar errors if i try python setup.py bdist_egg , python setup.py build_ext -i or make 还有非常类似的错误,如果我尝试使用python setup.py bdist_eggpython setup.py build_ext -imake

Trying to install via easy_install or pip produces the same error - although the former just hangs indefinitely. 尝试通过easy_install或pip安装会产生相同的错误-尽管前者会无限期地挂起。

As far as I am aware, all of the various dependencies, such as python-dev are installed. 据我所知,所有各种依赖项(例如python-dev)都已安装。

What am I missing / doing wrong? 我想念/做错了什么?

"I've checked out via svn " ... “我已经通过svn签出了” ...

"Building lxml version 2.3. alpha1 -76211" ... “建设LXML版本2.3。ALPHA1 -76211” ...

You appear to be on the bleeding edge. 您似乎处在前沿。 Suggestions: Use a released version of the lxml source. 建议:使用lxml源的发行版本。 Consult with the lxml author/maintainer. 请咨询lxml作者/维护者。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM