lxml installation: error: command 'gcc' failed with exit status 1
<p>I'm trying to install lxml, but I'm getting some sort of error.</p>

<pre><code># pip install lxml
DEPRECATION: Python 2.6 is no longer supported by the Python core team, please upgrade your Python. A future version of pip will drop support for Python 2.6
Collecting lxml
  Using cached lxml-3.6.4.tar.gz
Installing collected packages: lxml
  Running setup.py install for lxml ... error
    Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-9YW4Cf/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-bin1bn-record/install-record.txt --single-version-externally-managed --compile:
    Building lxml version 3.6.4.
    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
    creating build
    creating build/lib.linux-x86_64-2.6
    creating build/lib.linux-x86_64-2.6/lxml
    copying src/lxml/usedoctest.py -&gt; build/lib.linux-x86_64-2.6/lxml
    copying src/lxml/doctestcompare.py -&gt; build/lib.linux-x86_64-2.6/lxml
    copying src/lxml/ElementInclude.py -&gt; build/lib.linux-x86_64-2.6/lxml
    copying src/lxml/builder.py -&gt; build/lib.linux-x86_64-2.6/lxml
    copying src/lxml/pyclasslookup.py -&gt; build/lib.linux-x86_64-2.6/lxml
    copying src/lxml/_elementpath.py -&gt; build/lib.linux-x86_64-2.6/lxml
    copying src/lxml/cssselect.py -&gt; build/lib.linux-x86_64-2.6/lxml
    copying src/lxml/__init__.py -&gt; build/lib.linux-x86_64-2.6/lxml
    copying src/lxml/sax.py -&gt; build/lib.linux-x86_64-2.6/lxml
    creating build/lib.linux-x86_64-2.6/lxml/includes
    copying src/lxml/includes/__init__.py -&gt; build/lib.linux-x86_64-2.6/lxml/includes
    creating build/lib.linux-x86_64-2.6/lxml/html
    copying src/lxml/html/usedoctest.py -&gt; build/lib.linux-x86_64-2.6/lxml/html
    copying src/lxml/html/_setmixin.py -&gt; build/lib.linux-x86_64-2.6/lxml/html
    copying src/lxml/html/formfill.py -&gt; build/lib.linux-x86_64-2.6/lxml/html
    copying src/lxml/html/clean.py -&gt; build/lib.linux-x86_64-2.6/lxml/html
    copying src/lxml/html/soupparser.py -&gt; build/lib.linux-x86_64-2.6/lxml/html
    copying src/lxml/html/_html5builder.py -&gt; build/lib.linux-x86_64-2.6/lxml/html
    copying src/lxml/html/defs.py -&gt; build/lib.linux-x86_64-2.6/lxml/html
    copying src/lxml/html/builder.py -&gt; build/lib.linux-x86_64-2.6/lxml/html
    copying src/lxml/html/ElementSoup.py -&gt; build/lib.linux-x86_64-2.6/lxml/html
    copying src/lxml/html/diff.py -&gt; build/lib.linux-x86_64-2.6/lxml/html
    copying src/lxml/html/_diffcommand.py -&gt; build/lib.linux-x86_64-2.6/lxml/html
    copying src/lxml/html/__init__.py -&gt; build/lib.linux-x86_64-2.6/lxml/html
    copying src/lxml/html/html5parser.py -&gt; build/lib.linux-x86_64-2.6/lxml/html
    creating build/lib.linux-x86_64-2.6/lxml/isoschematron
    copying src/lxml/isoschematron/__init__.py -&gt; build/lib.linux-x86_64-2.6/lxml/isoschematron
    copying src/lxml/lxml.etree.h -&gt; build/lib.linux-x86_64-2.6/lxml
    copying src/lxml/lxml.etree_api.h -&gt; build/lib.linux-x86_64-2.6/lxml
    copying src/lxml/includes/relaxng.pxd -&gt; build/lib.linux-x86_64-2.6/lxml/includes
    copying src/lxml/includes/tree.pxd -&gt; build/lib.linux-x86_64-2.6/lxml/includes
    copying src/lxml/includes/xpath.pxd -&gt; build/lib.linux-x86_64-2.6/lxml/includes
    copying src/lxml/includes/config.pxd -&gt; build/lib.linux-x86_64-2.6/lxml/includes
    copying src/lxml/includes/etreepublic.pxd -&gt; build/lib.linux-x86_64-2.6/lxml/includes
    copying src/lxml/includes/xinclude.pxd -&gt; build/lib.linux-x86_64-2.6/lxml/includes
    copying src/lxml/includes/uri.pxd -&gt; build/lib.linux-x86_64-2.6/lxml/includes
    copying src/lxml/includes/xmlparser.pxd -&gt; build/lib.linux-x86_64-2.6/lxml/includes
    copying src/lxml/includes/c14n.pxd -&gt; build/lib.linux-x86_64-2.6/lxml/includes
    copying src/lxml/includes/htmlparser.pxd -&gt; build/lib.linux-x86_64-2.6/lxml/includes
    copying src/lxml/includes/xslt.pxd -&gt; build/lib.linux-x86_64-2.6/lxml/includes
    copying src/lxml/includes/xmlschema.pxd -&gt; build/lib.linux-x86_64-2.6/lxml/includes
    copying src/lxml/includes/xmlerror.pxd -&gt; build/lib.linux-x86_64-2.6/lxml/includes
    copying src/lxml/includes/schematron.pxd -&gt; build/lib.linux-x86_64-2.6/lxml/includes
    copying src/lxml/includes/dtdvalid.pxd -&gt; build/lib.linux-x86_64-2.6/lxml/includes
    copying src/lxml/includes/lxml-version.h -&gt; build/lib.linux-x86_64-2.6/lxml/includes
    copying src/lxml/includes/etree_defs.h -&gt; build/lib.linux-x86_64-2.6/lxml/includes
    creating build/lib.linux-x86_64-2.6/lxml/isoschematron/resources
    creating build/lib.linux-x86_64-2.6/lxml/isoschematron/resources/rng
    copying src/lxml/isoschematron/resources/rng/iso-schematron.rng -&gt; build/lib.linux-x86_64-2.6/lxml/isoschematron/resources/rng
    creating build/lib.linux-x86_64-2.6/lxml/isoschematron/resources/xsl
    copying src/lxml/isoschematron/resources/xsl/XSD2Schtrn.xsl -&gt; build/lib.linux-x86_64-2.6/lxml/isoschematron/resources/xsl
    copying src/lxml/isoschematron/resources/xsl/RNG2Schtrn.xsl -&gt; build/lib.linux-x86_64-2.6/lxml/isoschematron/resources/xsl
    creating build/lib.linux-x86_64-2.6/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
    copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_svrl_for_xslt1.xsl -&gt; build/lib.linux-x86_64-2.6/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
    copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_message.xsl -&gt; build/lib.linux-x86_64-2.6/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
    copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_dsdl_include.xsl -&gt; build/lib.linux-x86_64-2.6/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
    copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_skeleton_for_xslt1.xsl -&gt; build/lib.linux-x86_64-2.6/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
    copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_abstract_expand.xsl -&gt; build/lib.linux-x86_64-2.6/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
    copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/readme.txt -&gt; build/lib.linux-x86_64-2.6/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
    running build_ext
    building 'lxml.etree' extension
    creating build/temp.linux-x86_64-2.6
    creating build/temp.linux-x86_64-2.6/src
    creating build/temp.linux-x86_64-2.6/src/lxml
    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 -Isrc/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
    {standard input}: Assembler messages:
    {standard input}:224305: Warning: end of file in string; '"' inserted
    gcc: Internal error: Killed (program cc1)
    Please submit a full bug report.
    See &lt;http://bugzilla.redhat.com/bugzilla&gt; for instructions.
    Compile failed: command 'gcc' failed with exit status 1
    creating tmp
    cc -I/usr/include/libxml2 -I/usr/include/libxml2 -c /tmp/xmlXPathInitDjSg3x.c -o tmp/xmlXPathInitDjSg3x.o
    cc tmp/xmlXPathInitDjSg3x.o -L/usr/lib64 -lxml2 -o a.out
    error: command 'gcc' failed with exit status 1

    ----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-9YW4Cf/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-bin1bn-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-9YW4Cf/lxml/
</code></pre>

<p>The solution was to run:</p>

<pre><code>yum install python-lxml
</code></pre>

python pip lxml