0
我想在運行Python 2.6的Ubuntu服務器(在virtualenv - 系統Python爲2.5)上安裝lxml。錯誤'lxml.etree'擴展
我已經通過svn簽出,因此我還安裝了Cython,as per the instructions。
但是,運行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
而且非常類似的錯誤,如果我嘗試python setup.py bdist_egg
,python setup.py build_ext -i
或make
嘗試安裝通過的easy_install或PIP產生同樣的錯誤 - 儘管前者無限期地懸掛着。
據我所知,所有的各種依賴,如python-dev都已安裝。
我在想什麼/做錯了什麼?
* sla額* - 感謝常識劑量。 lxml 2.2.6通過'python setup.py install'從tarball安裝。 – 2010-07-19 14:45:57