2014-10-03 4 views
2

У меня возникли проблемы с установкой lxml на CentOS-6. Я пробовал решения некоторых подобных вопросов, например, pip install lxml error или Setup.py: install lxml with Python2.6 on CentOS, но это не сработало. Как правильно установить его? после выдачи,gcc Внутренняя ошибка на установке lxml CentOS

pip install lxml 

Бревно, как это,

Downloading/unpacking lxml 
    Running setup.py egg_info for package lxml 
    /usr/lib64/python2.6/distutils/dist.py:266: UserWarning: Unknown distribution option: 'bugtrack_url' 
     warnings.warn(msg) 
    Building lxml version 3.4.0. 
    Building without Cython. 
    Using build configuration of libxslt 1.1.26 
    Building against libxml2/libxslt in the following directory: /usr/lib64 
Installing collected packages: lxml 
    Running setup.py install for lxml 
    /usr/lib64/python2.6/distutils/dist.py:266: UserWarning: Unknown distribution option: 'bugtrack_url' 
     warnings.warn(msg) 
    Building lxml version 3.4.0. 
    Building without Cython. 
    Using build configuration of libxslt 1.1.26 
    Building against libxml2/libxslt in the following directory: /usr/lib64 
    building 'lxml.etree' extension 
    gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/libxml2 -I/tmp/pip-build-root/lxml/src/lxml/includes -I/usr/include/python2.6 -c src/lxml/lxml.etree.c -o build/temp.linux-x86_64-2.6/src/lxml/lxml.etree.o -w 
    gcc: Internal error: Killed (program cc1) 
    Please submit a full bug report. 
    See <http://bugzilla.redhat.com/bugzilla> for instructions. 
    error: command 'gcc' failed with exit status 1 
    Complete output from command /usr/bin/python -c "import setuptools;__file__='/tmp/pip-build-root/lxml/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-07a07D-record/install-record.txt --single-version-externally-managed: 
    /usr/lib64/python2.6/distutils/dist.py:266: UserWarning: Unknown distribution option: 'bugtrack_url' 

    warnings.warn(msg) 

Building lxml version 3.4.0. 

Building without Cython. 

Using build configuration of libxslt 1.1.26 

Building against libxml2/libxslt in the following directory: /usr/lib64 

running install 

running build 

running build_py 

copying src/lxml/includes/lxml-version.h -> build/lib.linux-x86_64-2.6/lxml/includes 

running build_ext 

building 'lxml.etree' extension 

gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/libxml2 -I/tmp/pip-build-root/lxml/src/lxml/includes -I/usr/include/python2.6 -c src/lxml/lxml.etree.c -o build/temp.linux-x86_64-2.6/src/lxml/lxml.etree.o -w 

gcc: Internal error: Killed (program cc1) 

Please submit a full bug report. 

See <http://bugzilla.redhat.com/bugzilla> for instructions. 

error: command 'gcc' failed with exit status 1 

---------------------------------------- 
Command /usr/bin/python -c "import setuptools;__file__='/tmp/pip-build-root/lxml/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-07a07D-record/install-record.txt --single-version-externally-managed failed with error code 1 in /tmp/pip-build-root/lxml 
Storing complete log in /root/.pip/pip.log 

Traceback в pip.log:

Exception information: 
Traceback (most recent call last): 
    File "/usr/lib/python2.6/site-packages/pip/basecommand.py", line 139, in main 
    status = self.run(options, args) 
    File "/usr/lib/python2.6/site-packages/pip/commands/install.py", line 271, in run 
    requirement_set.install(install_options, global_options, root=options.root_path) 
    File "/usr/lib/python2.6/site-packages/pip/req.py", line 1185, in install 
    requirement.install(install_options, global_options, *args, **kwargs) 
    File "/usr/lib/python2.6/site-packages/pip/req.py", line 592, in install 
    cwd=self.source_dir, filter_stdout=self._filter_install, show_stdout=False) 
    File "/usr/lib/python2.6/site-packages/pip/util.py", line 662, in call_subprocess 
    % (command_desc, proc.returncode, cwd)) 
InstallationError: Command /usr/bin/python -c "import setuptools;__file__='/tmp/pip-build-root/lxml/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-cAMY23-record/install-record.txt --single-version-externally-managed failed with error code 1 in /tmp/pip-build-root/lxml 

Я использую Python 2.6.6 на CentOS release 6.5.

ответ

0

Во свежей среды установок/установки пакета наиболее распространенные проблемы, один может столкнуться в следующем:

  1. gcc не установлен - это C компилятор необходим для построения Python пакетов, как ядро ​​C.

    $sudo yum install gcc

  2. «ошибка: команда„НКУ“не удалось со статусом выхода 1» происходит, когда файлы заголовков (#include) не найден т.е. зависимостей не установлены

    Решение: установить зависимостей на уровне системы (пакеты разработки)

    $sudo yum install libxml2-devel libxml++-devel libxslt-devel

  3. в то время как в вас r case, 'gcc: Внутренняя ошибка: Killed (program cc1)' не может быть указанными выше возможностями, существуют зависимости, а не какая-либо «не найденная» ошибка для любых отсутствующих файлов заголовков или любая другая ошибка уровня синтаксиса , Что произошло (возможно), компилятор gcc разбился. Существует много возможностей, это проблема памяти, то есть низкая память.

    Хотя вы не указали, настроена ли вам виртуальная машина или встроенная установка - обычно мы выделяем ограниченную память при настройке виртуальной машины. Если вы используете VM, то возможный выход здесь - увеличить выделенную память для виртуальной машины CentOS или освободить некоторую память, закрыв любые ненужные запущенные программы и службы.

P.S. У меня была такая же проблема при установке lxml, и она была решена с большим объемом памяти.

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