0

我尝试使用命令安装 Glance

(os)mirror0@lab:~/tmp/glance$ python setup.py install

但是失败了,为什么?

src/lxml/lxml.etree.c:181079: error: ‘XML_PARSE_NOENT’ undeclared (first use in this function)
src/lxml/lxml.etree.c:181079: error: ‘XML_PARSE_NOCDATA’ undeclared (first use in this function)
src/lxml/lxml.etree.c:181079: error: ‘XML_PARSE_NONET’ undeclared (first use in this function)
src/lxml/lxml.etree.c:181374: error: ‘XML_PARSE_RECOVER’ undeclared (first use in this function)
src/lxml/lxml.etree.c:181374: error: ‘HTML_PARSE_NONET’ undeclared (first use in this function)
src/lxml/lxml.etree.c:182031: error: ‘XML_XPATH_NUMBER_ERROR’ undeclared (first use in this function)
src/lxml/lxml.etree.c:182041: error: ‘XML_XPATH_UNFINISHED_LITERAL_ERROR’ undeclared (first use in this function)
src/lxml/lxml.etree.c:182051: error: ‘XML_XPATH_VARIABLE_REF_ERROR’ undeclared (first use in this function)
src/lxml/lxml.etree.c:182061: error: ‘XML_XPATH_INVALID_PREDICATE_ERROR’ undeclared (first use in this function)
src/lxml/lxml.etree.c:182071: error: ‘XML_XPATH_UNCLOSED_ERROR’ undeclared (first use in this function)
src/lxml/lxml.etree.c:182081: error: ‘XML_XPATH_INVALID_CHAR_ERROR’ undeclared (first use in this function)
src/lxml/lxml.etree.c:182116: error: ‘XML_XPATH_UNDEF_VARIABLE_ERROR’ undeclared (first use in this function)
src/lxml/lxml.etree.c:182126: error: ‘XML_XPATH_UNDEF_PREFIX_ERROR’ undeclared (first use in this function)
src/lxml/lxml.etree.c:182136: error: ‘XML_XPATH_UNKNOWN_FUNC_ERROR’ undeclared (first use in this function)
src/lxml/lxml.etree.c:182146: error: ‘XML_XPATH_INVALID_OPERAND’ undeclared (first use in this function)
src/lxml/lxml.etree.c:182156: error: ‘XML_XPATH_INVALID_TYPE’ undeclared (first use in this function)
src/lxml/lxml.etree.c:182166: error: ‘XML_XPATH_INVALID_ARITY’ undeclared (first use in this function)
src/lxml/lxml.etree.c:182176: error: ‘XML_XPATH_INVALID_CTXT_SIZE’ undeclared (first use in this function)
src/lxml/lxml.etree.c:182186: error: ‘XML_XPATH_INVALID_CTXT_POSITION’ undeclared (first use in this function)
src/lxml/lxml.etree.c:182532: error: ‘LIBXSLT_VERSION’ undeclared (first use in this function)
src/lxml/lxml.etree.c:182544: error: ‘xsltLibxsltVersion’ undeclared (first use in this function)
src/lxml/lxml.etree.c:182556: error: ‘__pyx_v_4lxml_5etree_XSLT_DOC_DEFAULT_LOADER’ undeclared (first use in this function)
src/lxml/lxml.etree.c:182556: error: ‘xsltDocDefaultLoader’ undeclared (first use in this function)
src/lxml/lxml.etree.c:182565: warning: implicit declaration of function ‘xsltSetLoaderFunc’
src/lxml/lxml.etree.c:182565: error: ‘xsltDocLoaderFunc’ undeclared (first use in this function)
src/lxml/lxml.etree.c:182565: error: expected ‘)’ before ‘__pyx_f_4lxml_5etree__xslt_doc_loader’
src/lxml/lxml.etree.c:182816: warning: implicit declaration of function ‘xsltRegisterAllExtras’
src/lxml/lxml.etree.c:182825: warning: implicit declaration of function ‘exsltRegisterAll’
error: Setup script exited with error: command 'gcc' failed with exit status 1
(os)mirror0@lab:~/tmp/glance$ echo $?
1


(os)mirror0@lab:~/tmp/glance$ python -V
Python 2.6.6

编辑1:我已经安装了libxml2-dev,仍然无法安装glance,为什么?

src/lxml/lxml.etree.c:181079: error: ‘XML_PARSE_NONET’ undeclared (first use in this function)
src/lxml/lxml.etree.c:181374: error: ‘XML_PARSE_RECOVER’ undeclared (first use in this function)
src/lxml/lxml.etree.c:181374: error: ‘HTML_PARSE_NONET’ undeclared (first use in this function)
src/lxml/lxml.etree.c:182031: error: ‘XML_XPATH_NUMBER_ERROR’ undeclared (first use in this function)
src/lxml/lxml.etree.c:182041: error: ‘XML_XPATH_UNFINISHED_LITERAL_ERROR’ undeclared (first use in this function)
src/lxml/lxml.etree.c:182051: error: ‘XML_XPATH_VARIABLE_REF_ERROR’ undeclared (first use in this function)
src/lxml/lxml.etree.c:182061: error: ‘XML_XPATH_INVALID_PREDICATE_ERROR’ undeclared (first use in this function)
src/lxml/lxml.etree.c:182071: error: ‘XML_XPATH_UNCLOSED_ERROR’ undeclared (first use in this function)
src/lxml/lxml.etree.c:182081: error: ‘XML_XPATH_INVALID_CHAR_ERROR’ undeclared (first use in this function)
src/lxml/lxml.etree.c:182116: error: ‘XML_XPATH_UNDEF_VARIABLE_ERROR’ undeclared (first use in this function)
src/lxml/lxml.etree.c:182126: error: ‘XML_XPATH_UNDEF_PREFIX_ERROR’ undeclared (first use in this function)
src/lxml/lxml.etree.c:182136: error: ‘XML_XPATH_UNKNOWN_FUNC_ERROR’ undeclared (first use in this function)
src/lxml/lxml.etree.c:182146: error: ‘XML_XPATH_INVALID_OPERAND’ undeclared (first use in this function)
src/lxml/lxml.etree.c:182156: error: ‘XML_XPATH_INVALID_TYPE’ undeclared (first use in this function)
src/lxml/lxml.etree.c:182166: error: ‘XML_XPATH_INVALID_ARITY’ undeclared (first use in this function)
src/lxml/lxml.etree.c:182176: error: ‘XML_XPATH_INVALID_CTXT_SIZE’ undeclared (first use in this function)
src/lxml/lxml.etree.c:182186: error: ‘XML_XPATH_INVALID_CTXT_POSITION’ undeclared (first use in this function)
src/lxml/lxml.etree.c:182532: error: ‘LIBXSLT_VERSION’ undeclared (first use in this function)
src/lxml/lxml.etree.c:182544: error: ‘xsltLibxsltVersion’ undeclared (first use in this function)
src/lxml/lxml.etree.c:182556: error: ‘__pyx_v_4lxml_5etree_XSLT_DOC_DEFAULT_LOADER’ undeclared (first use in this function)
src/lxml/lxml.etree.c:182556: error: ‘xsltDocDefaultLoader’ undeclared (first use in this function)
src/lxml/lxml.etree.c:182565: warning: implicit declaration of function ‘xsltSetLoaderFunc’
src/lxml/lxml.etree.c:182565: error: ‘xsltDocLoaderFunc’ undeclared (first use in this function)
src/lxml/lxml.etree.c:182565: error: expected ‘)’ before ‘__pyx_f_4lxml_5etree__xslt_doc_loader’
src/lxml/lxml.etree.c:182816: warning: implicit declaration of function ‘xsltRegisterAllExtras’
src/lxml/lxml.etree.c:182825: warning: implicit declaration of function ‘exsltRegisterAll’
error: Setup script exited with error: command 'gcc' failed with exit status 1
(os)mirror0@lab:~/tmp/glance$ dpkg -l | grep libxml2
ii  libxml2                              2.7.8.dfsg-2+squeeze5               GNOME XML library
ii  libxml2-dev                          2.7.8.dfsg-2+squeeze5               Development files for the GNOME XML library
ii  libxml2-utils                        2.7.8.dfsg-2+squeeze5               XML utilities
ii  python-libxml2                       2.7.8.dfsg-2+squeeze5               Python bindings for the GNOME XML library
ii  python-lxml                          2.2.8-2                             pythonic binding for the libxml2 and libxslt libraries
4

1 回答 1

1

尝试安装Libxslt。对于 Ubuntu:

sudo apt-get install libxslt1.1 libxslt1-dev python-libxslt1
于 2012-10-17T05:01:33.700 回答