简体   繁体   English

在Centos 7上安装lxml - 错误:命令'gcc'失败,退出状态为4

[英]Install lxml on Centos 7 - error: command 'gcc' failed with exit status 4

I'm using python 3.4 in a virtual environment: 我在虚拟环境中使用python 3.4:

(af)[root@domain backend]# pip --version
pip 7.1.0 from /home/af/af-stage/backend/.ves/af/lib/python3.4/site-packages (python 3.4)

Installation of lxml failed "error: command 'gcc' failed with exit status 4": 安装lxml失败“错误:命令'gcc'失败,退出状态为4”:

(af)[root@domain backend]# pip install lxml
You are using pip version 7.1.0, however version 7.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Collecting lxml
  Using cached lxml-3.5.0.tar.gz
Building wheels for collected packages: lxml
  Running setup.py bdist_wheel for lxml
  Complete output from command /home/af/af-stage/backend/.ves/af/bin/python3.4 -c "import setuptools;__file__='/tmp/pip-build-tlogtyk2/lxml/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmpod9hcw0ypip-wheel-:
  Building lxml version 3.5.0.
  Building without Cython.
  Using build configuration of libxslt 1.1.28
  Building against libxml2/libxslt in the following directory: /usr/lib64
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.4
  creating build/lib.linux-x86_64-3.4/lxml
  copying src/lxml/usedoctest.py -> build/lib.linux-x86_64-3.4/lxml
  copying src/lxml/__init__.py -> build/lib.linux-x86_64-3.4/lxml
  copying src/lxml/builder.py -> build/lib.linux-x86_64-3.4/lxml
  copying src/lxml/sax.py -> build/lib.linux-x86_64-3.4/lxml
  copying src/lxml/doctestcompare.py -> build/lib.linux-x86_64-3.4/lxml
  copying src/lxml/_elementpath.py -> build/lib.linux-x86_64-3.4/lxml
  copying src/lxml/cssselect.py -> build/lib.linux-x86_64-3.4/lxml
  copying src/lxml/ElementInclude.py -> build/lib.linux-x86_64-3.4/lxml
  copying src/lxml/pyclasslookup.py -> build/lib.linux-x86_64-3.4/lxml
  creating build/lib.linux-x86_64-3.4/lxml/includes
  copying src/lxml/includes/__init__.py -> build/lib.linux-x86_64-3.4/lxml/includes
  creating build/lib.linux-x86_64-3.4/lxml/html
  copying src/lxml/html/usedoctest.py -> build/lib.linux-x86_64-3.4/lxml/html
  copying src/lxml/html/html5parser.py -> build/lib.linux-x86_64-3.4/lxml/html
  copying src/lxml/html/__init__.py -> build/lib.linux-x86_64-3.4/lxml/html
  copying src/lxml/html/_html5builder.py -> build/lib.linux-x86_64-3.4/lxml/html
  copying src/lxml/html/builder.py -> build/lib.linux-x86_64-3.4/lxml/html
  copying src/lxml/html/_setmixin.py -> build/lib.linux-x86_64-3.4/lxml/html
  copying src/lxml/html/_diffcommand.py -> build/lib.linux-x86_64-3.4/lxml/html
  copying src/lxml/html/ElementSoup.py -> build/lib.linux-x86_64-3.4/lxml/html
  copying src/lxml/html/formfill.py -> build/lib.linux-x86_64-3.4/lxml/html
  copying src/lxml/html/soupparser.py -> build/lib.linux-x86_64-3.4/lxml/html
  copying src/lxml/html/diff.py -> build/lib.linux-x86_64-3.4/lxml/html
  copying src/lxml/html/defs.py -> build/lib.linux-x86_64-3.4/lxml/html
  copying src/lxml/html/clean.py -> build/lib.linux-x86_64-3.4/lxml/html
  creating build/lib.linux-x86_64-3.4/lxml/isoschematron
  copying src/lxml/isoschematron/__init__.py -> build/lib.linux-x86_64-3.4/lxml/isoschematron
  copying src/lxml/lxml.etree.h -> build/lib.linux-x86_64-3.4/lxml
  copying src/lxml/lxml.etree_api.h -> build/lib.linux-x86_64-3.4/lxml
  copying src/lxml/includes/etreepublic.pxd -> build/lib.linux-x86_64-3.4/lxml/includes
  copying src/lxml/includes/uri.pxd -> build/lib.linux-x86_64-3.4/lxml/includes
  copying src/lxml/includes/xmlschema.pxd -> build/lib.linux-x86_64-3.4/lxml/includes
  copying src/lxml/includes/config.pxd -> build/lib.linux-x86_64-3.4/lxml/includes
  copying src/lxml/includes/xmlerror.pxd -> build/lib.linux-x86_64-3.4/lxml/includes
  copying src/lxml/includes/xslt.pxd -> build/lib.linux-x86_64-3.4/lxml/includes
  copying src/lxml/includes/tree.pxd -> build/lib.linux-x86_64-3.4/lxml/includes
  copying src/lxml/includes/xpath.pxd -> build/lib.linux-x86_64-3.4/lxml/includes
  copying src/lxml/includes/relaxng.pxd -> build/lib.linux-x86_64-3.4/lxml/includes
  copying src/lxml/includes/htmlparser.pxd -> build/lib.linux-x86_64-3.4/lxml/includes
  copying src/lxml/includes/xinclude.pxd -> build/lib.linux-x86_64-3.4/lxml/includes
  copying src/lxml/includes/xmlparser.pxd -> build/lib.linux-x86_64-3.4/lxml/includes
  copying src/lxml/includes/schematron.pxd -> build/lib.linux-x86_64-3.4/lxml/includes
  copying src/lxml/includes/dtdvalid.pxd -> build/lib.linux-x86_64-3.4/lxml/includes
  copying src/lxml/includes/c14n.pxd -> build/lib.linux-x86_64-3.4/lxml/includes
  copying src/lxml/includes/lxml-version.h -> build/lib.linux-x86_64-3.4/lxml/includes
  copying src/lxml/includes/etree_defs.h -> build/lib.linux-x86_64-3.4/lxml/includes
  creating build/lib.linux-x86_64-3.4/lxml/isoschematron/resources
  creating build/lib.linux-x86_64-3.4/lxml/isoschematron/resources/rng
  copying src/lxml/isoschematron/resources/rng/iso-schematron.rng -> build/lib.linux-x86_64-3.4/lxml/isoschematron/resources/rng
  creating build/lib.linux-x86_64-3.4/lxml/isoschematron/resources/xsl
  copying src/lxml/isoschematron/resources/xsl/RNG2Schtrn.xsl -> build/lib.linux-x86_64-3.4/lxml/isoschematron/resources/xsl
  copying src/lxml/isoschematron/resources/xsl/XSD2Schtrn.xsl -> build/lib.linux-x86_64-3.4/lxml/isoschematron/resources/xsl
  creating build/lib.linux-x86_64-3.4/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
  copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_svrl_for_xslt1.xsl -> build/lib.linux-x86_64-3.4/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
  copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_dsdl_include.xsl -> build/lib.linux-x86_64-3.4/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
  copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_abstract_expand.xsl -> build/lib.linux-x86_64-3.4/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
  copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_message.xsl -> build/lib.linux-x86_64-3.4/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
  copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_skeleton_for_xslt1.xsl -> build/lib.linux-x86_64-3.4/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
  copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/readme.txt -> build/lib.linux-x86_64-3.4/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
  running build_ext
  building 'lxml.etree' extension
  creating build/temp.linux-x86_64-3.4
  creating build/temp.linux-x86_64-3.4/src
  creating build/temp.linux-x86_64-3.4/src/lxml
  gcc -pthread -Wno-unused-result -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/libxml2 -Isrc/lxml/includes -I/usr/include/python3.4m -c src/lxml/lxml.etree.c -o build/temp.linux-x86_64-3.4/src/lxml/lxml.etree.o -w
  {standard input}: Assembler messages:
  {standard input}:1531298: Error: unknown pseudo-op: `.uleb'
  gcc: internal compiler error: Killed (program cc1)
  Please submit a full bug report,
  with preprocessed source if appropriate.
  See <http://bugzilla.redhat.com/bugzilla> for instructions.
  Compile failed: command 'gcc' failed with exit status 4
  creating tmp
  cc -I/usr/include/libxml2 -I/usr/include/libxml2 -c /tmp/xmlXPathInitpm92p5c8.c -o tmp/xmlXPathInitpm92p5c8.o
  cc tmp/xmlXPathInitpm92p5c8.o -L/usr/lib64 -lxml2 -o a.out
  error: command 'gcc' failed with exit status 4

  ----------------------------------------
  Failed building wheel for lxml
Failed to build lxml
Installing collected packages: lxml
  Running setup.py install for lxml
    Complete output from command /home/af/af-stage/backend/.ves/af/bin/python3.4 -c "import setuptools, tokenize;__file__='/tmp/pip-build-tlogtyk2/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-99hwjy1o-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/af/af-stage/backend/.ves/af/include/site/python3.4/lxml:
    Building lxml version 3.5.0.
    Building without Cython.
    Using build configuration of libxslt 1.1.28
    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-3.4/lxml/includes
    running build_ext
    building 'lxml.etree' extension
    gcc -pthread -Wno-unused-result -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/libxml2 -Isrc/lxml/includes -I/usr/include/python3.4m -c src/lxml/lxml.etree.c -o build/temp.linux-x86_64-3.4/src/lxml/lxml.etree.o -w
    {standard input}: Assembler messages:
    {standard input}:1320351: Error: unknown pseudo-op: `.uleb1'
    gcc: internal compiler error: Killed (program cc1)
    Please submit a full bug report,
    with preprocessed source if appropriate.
    See <http://bugzilla.redhat.com/bugzilla> for instructions.
    Compile failed: command 'gcc' failed with exit status 4
    cc -I/usr/include/libxml2 -I/usr/include/libxml2 -c /tmp/xmlXPathInit3tj66iu0.c -o tmp/xmlXPathInit3tj66iu0.o
    cc tmp/xmlXPathInit3tj66iu0.o -L/usr/lib64 -lxml2 -o a.out
    error: command 'gcc' failed with exit status 4

    ----------------------------------------
Command "/home/af/af-stage/backend/.ves/af/bin/python3.4 -c "import setuptools, tokenize;__file__='/tmp/pip-build-tlogtyk2/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-99hwjy1o-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/af/af-stage/backend/.ves/af/include/site/python3.4/lxml" failed with error code 1 in /tmp/pip-build-tlogtyk2/lxml

Notes: 笔记:
I've already done yum install libxslt-devel libxml2-devel 我已经完成了yum install libxslt-devel libxml2-devel

You just need to use yum install python-lxml . 你只需要使用yum install python-lxml Of course, lxml module depend on libxml2 libxslt libxml2-devel libxslt-devel. 当然,lxml模块依赖于libxml2 libxslt libxml2-devel libxslt-devel。

It works after installing: 它安装后工作:

libxml++-2.30.0-1.el6.i686
libsigc++20-devel-2.2.4.2-1.el6.i686
libxml2-static-2.7.6-21.el6_8.1.i686
libxml++-devel-2.30.0-1.el6.i686
libxslt-python-1.1.26-2.el6_3.1.i686
gccxml-0.9.0-0.27.20150423.git3afa8ba.el6.i686

我将我的lxml版本从3.7.0更新到最新版本4.1.1,这对我有用。

这对我yum install -y libxml2 libxml2-devel libxslt libxslt-develyum install -y libxml2 libxml2-devel libxslt libxslt-devel

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 错误:命令“gcc”在 CentOS 上失败,退出状态为 1 - error: command 'gcc' failed with exit status 1 on CentOS lxml 安装:错误:命令“gcc”失败,退出状态为 1 - lxml installation: error: command 'gcc' failed with exit status 1 错误:命令&#39;gcc&#39;失败,在centos 6.5上的退出状态为1 - error: command 'gcc' failed with exit status 1 on centos 6.5 pip install pyhs2错误:命令“ gcc”失败,退出状态为1 - pip install pyhs2 error: command 'gcc' failed with exit status 1 “Pip install”导致“错误:命令‘gcc’失败,退出状态为 1” - “Pip install” causing “error: command 'gcc' failed with exit status 1” 尝试安装 OpenDR 时出现错误(命令“gcc”失败,退出状态为 1) - Error (command 'gcc' failed with exit status 1) when trying to install OpenDR lxml:错误:命令&#39;x86_64-linux-gnu-gcc&#39;失败,退出状态为1 - lxml: error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 在 virtualenv Ubuntu 12.10 中使用 pip 安装 lxml 错误:命令“gcc”失败,退出状态为 4 - Installing lxml with pip in virtualenv Ubuntu 12.10 error: command 'gcc' failed with exit status 4 错误命令gcc失败,退出状态为1 - error command gcc failed with exit status 1 错误:命令“ gcc”失败,退出状态为1 - error: command 'gcc' failed with exit status 1
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM