gcc lxml安装CentOS上的内部错误 [英] gcc Internal error on lxml installation CentOS

查看:210
本文介绍了gcc lxml安装CentOS上的内部错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 CentOS-6 上安装 lxml 时遇到了一些麻烦。我尝试过一些类似问题的解决方案,例如 pip install lxml错误 Setup.py:在CentOS上使用Python2.6安装lxml ,但这些都不起作用。如何正确安装?发出后

  pip install lxml 

日志是这样,

 下载/解压lxml 
对于包lxml运行setup.py egg_info
/usr/lib64/python2.6/distutils/dist.py:266:UserWarning:未知分发选项:'bugtrack_url'
warnings.warn(msg)
构建lxml版本3.4.0。
构建没有Cython。
使用libxslt的构建配置1.1.26
构建在以下目录中的libxml2 / libxslt:/ usr / lib64
安装收集的软件包:lxml
运行setup.py install for lxml
/usr/lib64/python2.6/distutils/dist.py:266:UserWarning:未知分发选项:'bugtrack_url'
warnings.warn(msg)
构建lxml版本3.4.0 。
构建没有Cython。
使用libxslt的构建配置1.1.26
构建在以下目录中的libxml2 / libxslt:/ usr / lib64
构建'lxml.etree'扩展
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:内部错误:Killed(程序cc1)
请提交完整的错误报告。
参见< http://bugzilla.redhat.com/bugzilla>以获取说明。
错误:命令'gcc'失败,退出状态1
从命令/ usr / bin / python -c完成输出import setuptools; __ file __ ='/ tmp / pip-build-root / lxml / setup .py'; exec(compile(open(__ file __)。read()。replace('\r\\\
','\\\
'),__file__,'exec'))install --record / tmp / pip-07a07D-record / install-record.txt - 单独版本外部管理:
/usr/lib64/python2.6/distutils/dist.py:266:UserWarning:未知分发选项:'bugtrack_url '

warnings.warn(msg)

构建lxml版本3.4.0。

构建没有Cython。

使用libxslt的构建配置1.1.26

构建在以下目录中的libxml2 / libxslt:/ usr / lib64

运行install

运行构建

运行build_py

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

运行build_ext

构建'lxml.etree'扩展

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:内部错误:Killed(程序cc1)

请提交完整的错误报告。

参见< http://bugzilla.redhat.com/bugzilla>以获取说明。

错误:命令'gcc'失败,退出状态1

----------------------- -----------------
命令/ usr / bin / python -cimport setuptools; __ file __ ='/ tmp / pip-build-root / lxml / setup。 py'; exec(compile(open(__ file __)。read()。replace('\r\\\
','\\\
'),__file__,'exec'))install --record / tmp / pip -07a07D-record / install-record.txt - 单独版本外部管理失败,错误代码1在/ tmp / pip-build-root / lxml中
将完整日志存储在/root/pip/pip .log

pip.log 中追溯:

 异常信息:
回溯(最近调用最后一次):
文件/ usr / lib / python2.6 / site-packages / pip / basecommand.py,行139,在主
status = self.run(options,args)
文件/usr/lib/python2.6/site -packages / pip / commands / install.py,行271,在运行
require_set.install(install_options,global_options,root = options.root_path)
文件/usr/lib/python2.6/ site-packages / pip / req.py,行1185,在install
require.install(install_options,global_options,* args,** kwargs)
文件/usr/lib/python2.6/ site-packages / pip / req.py,行592,在安装
cwd = self.source_dir,filter_stdout = self._filter_install,show_stdout = False)
文件/usr/lib/python2.6 /site-packages/pip/util.py,第662行,在call_subprocess
%(command_desc,proc.returncode,cwd))
InstallationError:Command / usr / bin / python -cimport setuptools ; __ file __ ='/ tmp / pip-build-root / lxml / setup.py'; exec(compile(open(__ file __)。read()。replace('\r\\\
','\\\
') ,__file__,'exec'))install --record /tmp/pip-cAMY23-record/install-record.txt --single-version-external-managed失败,错误代码1在/ tmp / pip-build-root / lxml

我使用 Python 2.6.6 CentOS 6.5版

解决方案

安装可能遇到的最常见的问题如下:


  1. gcc 未安装 - 需要 C 编译器来构建 Python 软件包作为核心是 C



    $ sudo yum install gcc


  2. '错误:当没有找到头文件(#include),即没有安装依赖项时,命令'gcc'退出状态1 失败



    解决方案:安装系统级依赖(开发包)



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

    t是上面的可能性,依赖关系存在,因为没有一些未找到错误的任何丢失的头文件,或任何其他语法级错误。
    发生了什么(可能), gcc 编译器崩溃。有一个相当大的可能性是一个内存问题,即低内存。



    虽然您没有提到是否设置了VM或本机安装 - 通常我们在设置VM时分配有限的内存。如果你使用VM,这里可能的方法是增加 CentOS VM的分配内存,或者通过关闭任何不必要的正在运行的程序和服务释放一些内存。 p>


PS我有同样的问题,同时安装 lxml ,并解决了更多的内存。


I am having some trouble installing lxml on CentOS-6. I have tried the solutions of some similar questions like, pip install lxml error or Setup.py: install lxml with Python2.6 on CentOS but these did not work. How to install it correctly? after issuing,

pip install lxml

The log is like this,

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 in 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

I am using Python 2.6.6 on CentOS release 6.5.

解决方案

During fresh environment setups/package installation the most common issues one may face are as follows:

  1. gcc is not installed - a C compiler is needed for building Python packages as the core is C.

    $sudo yum install gcc

  2. 'error: command 'gcc' failed with exit status 1' happens when the header files (#include ) is not found i.e. the dependencies are not installed

    Solution: install the system level dependencies (development packages)

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

  3. while in your case, 'gcc: Internal error: Killed (program cc1)' can't be the above possibilities, the dependencies are there, as not some 'not found' error for any missing header files, or any other syntax level error. What has happened (probably), the gcc compiler crashed. There's a fair amount of possibility it's a memory problem i.e. low memory.

    Though you haven't mentioned whether you have setup a VM or a native installation - usually we allocate limited memory while setting up VM. If you're using VM the possible way out here is to increase the allocated memory for the CentOS VM, or free some memory by closing any unnecessary running programs and services.

P.S. I had the same problem while installing lxml, and resolved it with more memory.

这篇关于gcc lxml安装CentOS上的内部错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆