2016-02-02 5 views
0

Во-первых, я нашел этот вопрос:Как установить lxml на ubuntu?

How to install lxml on Ubuntu

Но после того, как я попробовал все ответы на этой странице, это не решить мою проблему. Моя проблема:

Когда я пытаюсь установить LXML, ошибка:

Installing egg-scripts. 
uses namespace packages but the distribution does not require setuptools. 
Getting distribution for 'lxml==3.0.1'. 
Building lxml version 3.0.1. 
Building without Cython. 
Using build configuration of libxslt 1.1.28 
warning: no files found matching '*.txt' under directory 'src/lxml/tests' 
src/lxml/lxml.etree.c: In function ‘__pyx_f_4lxml_5etree__getFilenameForFile’: 
src/lxml/lxml.etree.c:26310:7: warning: variable ‘__pyx_clineno’ set but not used [-Wunused-but-set-variable] 
    int __pyx_clineno = 0; 
    ^
src/lxml/lxml.etree.c:26309:15: warning: variable ‘__pyx_filename’ set but not used [-Wunused-but-set-variable] 
    const char *__pyx_filename = NULL; 
      ^
src/lxml/lxml.etree.c:26308:7: warning: variable ‘__pyx_lineno’ set but not used [-Wunused-but-set-variable] 
    int __pyx_lineno = 0; 
    ^
src/lxml/lxml.etree.c: In function ‘__pyx_f_4lxml_5etree__tostring’: 
src/lxml/lxml.etree.c:98614:7: warning: implicit declaration of function ‘xmlBufLength’ [-Wimplicit-function-declaration] 
     __pyx_t_6 = ((PyObject *)__Pyx_decode_c_string(((char *)((unsigned char *)xmlBufContent(__pyx_v_c_result_buffer))), 0, xmlBufLength(__pyx_v_c_result_buffer), NULL, NULL, PyUnicode_DecodeUTF8)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L16;} 
    ^
src/lxml/lxml.etree.c: In function ‘__pyx_pf_4lxml_5etree_4XSLT_18__call__’: 
src/lxml/lxml.etree.c:132608:81: warning: passing argument 1 of ‘__pyx_f_4lxml_5etree_12_XSLTContext__copy’ from incompatible pointer type [enabled by default] 
    __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree_12_XSLTContext__copy(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self->_context))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L9;} 
                       ^
src/lxml/lxml.etree.c:130569:52: note: expected ‘struct __pyx_obj_4lxml_5etree__XSLTContext *’ but argument is of type ‘struct __pyx_obj_4lxml_5etree__BaseContext *’ 
static struct __pyx_obj_4lxml_5etree__BaseContext *__pyx_f_4lxml_5etree_12_XSLTContext__copy(struct __pyx_obj_4lxml_5etree__XSLTContext *__pyx_v_self) { 
                ^
src/lxml/lxml.etree.c: In function ‘__pyx_f_4lxml_5etree__copyXSLT’: 
src/lxml/lxml.etree.c:133997:79: warning: passing argument 1 of ‘__pyx_f_4lxml_5etree_12_XSLTContext__copy’ from incompatible pointer type [enabled by default] 
    __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree_12_XSLTContext__copy(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_stylesheet->_context))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 680; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
                      ^
src/lxml/lxml.etree.c:130569:52: note: expected ‘struct __pyx_obj_4lxml_5etree__XSLTContext *’ but argument is of type ‘struct __pyx_obj_4lxml_5etree__BaseContext *’ 
static struct __pyx_obj_4lxml_5etree__BaseContext *__pyx_f_4lxml_5etree_12_XSLTContext__copy(struct __pyx_obj_4lxml_5etree__XSLTContext *__pyx_v_self) { 
                ^
src/lxml/lxml.etree.c: At top level: 
src/lxml/lxml.etree.c:12128:13: warning: ‘__pyx_f_4lxml_5etree_displayNode’ defined but not used [-Wunused-function] 
static void __pyx_f_4lxml_5etree_displayNode(xmlNode *__pyx_v_c_node, PyObject *__pyx_v_indent) { 
      ^
x86_64-linux-gnu-gcc: internal compiler error: Killed (program cc1) 
Please submit a full bug report, 
with preprocessed source if appropriate. 
See <file:///usr/share/doc/gcc-4.8/README.Bugs> for instructions. 
error: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 4 
An error occurred when trying to install lxml 3.0.1. Look above this message for any errors that were output by easy_install. 
While: 
    Installing egg-scripts. 
    Getting distribution for 'lxml==3.0.1'. 
Error: Couldn't install: lxml 3.0.1 

Мой Ubuntu является Ubuntu 14.04.3 LTS.

+2

[Другие темы] (http://stackoverflow.com/questions/24455238/lxml-installation-error-ubuntu- 14-04-internal-compiler-error) упомянули, что статус выхода 4 является проблемой памяти. У вас достаточно памяти во время компиляции? – univerio

+0

Спасибо. Ты прав. После того, как я увеличил свою память. Оно работает! – ithelloworld

ответ

0

попробовать:

sudo apt-get install python-libxslt1 python-libxslt1-dbg 
+0

Благодарим вас за ответ. Как сказал @univerio, проблема была в памяти :) – ithelloworld

Смежные вопросы