我试图安装lxml,但我遇到了某种错误。
# 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 -> build/lib.linux-x86_64-2.6/lxml
copying src/lxml/doctestcompare.py -> build/lib.linux-x86_64-2.6/lxml
copying src/lxml/ElementInclude.py -> build/lib.linux-x86_64-2.6/lxml
copying src/lxml/builder.py -> build/lib.linux-x86_64-2.6/lxml
copying src/lxml/pyclasslookup.py -> build/lib.linux-x86_64-2.6/lxml
copying src/lxml/_elementpath.py -> build/lib.linux-x86_64-2.6/lxml
copying src/lxml/cssselect.py -> build/lib.linux-x86_64-2.6/lxml
copying src/lxml/__init__.py -> build/lib.linux-x86_64-2.6/lxml
copying src/lxml/sax.py -> build/lib.linux-x86_64-2.6/lxml
creating build/lib.linux-x86_64-2.6/lxml/includes
copying src/lxml/includes/__init__.py -> 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 -> build/lib.linux-x86_64-2.6/lxml/html
copying src/lxml/html/_setmixin.py -> build/lib.linux-x86_64-2.6/lxml/html
copying src/lxml/html/formfill.py -> build/lib.linux-x86_64-2.6/lxml/html
copying src/lxml/html/clean.py -> build/lib.linux-x86_64-2.6/lxml/html
copying src/lxml/html/soupparser.py -> build/lib.linux-x86_64-2.6/lxml/html
copying src/lxml/html/_html5builder.py -> build/lib.linux-x86_64-2.6/lxml/html
copying src/lxml/html/defs.py -> build/lib.linux-x86_64-2.6/lxml/html
copying src/lxml/html/builder.py -> build/lib.linux-x86_64-2.6/lxml/html
copying src/lxml/html/ElementSoup.py -> build/lib.linux-x86_64-2.6/lxml/html
copying src/lxml/html/diff.py -> build/lib.linux-x86_64-2.6/lxml/html
copying src/lxml/html/_diffcommand.py -> build/lib.linux-x86_64-2.6/lxml/html
copying src/lxml/html/__init__.py -> build/lib.linux-x86_64-2.6/lxml/html
copying src/lxml/html/html5parser.py -> 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 -> build/lib.linux-x86_64-2.6/lxml/isoschematron
copying src/lxml/lxml.etree.h -> build/lib.linux-x86_64-2.6/lxml
copying src/lxml/lxml.etree_api.h -> build/lib.linux-x86_64-2.6/lxml
copying src/lxml/includes/relaxng.pxd -> build/lib.linux-x86_64-2.6/lxml/includes
copying src/lxml/includes/tree.pxd -> build/lib.linux-x86_64-2.6/lxml/includes
copying src/lxml/includes/xpath.pxd -> build/lib.linux-x86_64-2.6/lxml/includes
copying src/lxml/includes/config.pxd -> build/lib.linux-x86_64-2.6/lxml/includes
copying src/lxml/includes/etreepublic.pxd -> build/lib.linux-x86_64-2.6/lxml/includes
copying src/lxml/includes/xinclude.pxd -> build/lib.linux-x86_64-2.6/lxml/includes
copying src/lxml/includes/uri.pxd -> build/lib.linux-x86_64-2.6/lxml/includes
copying src/lxml/includes/xmlparser.pxd -> build/lib.linux-x86_64-2.6/lxml/includes
copying src/lxml/includes/c14n.pxd -> build/lib.linux-x86_64-2.6/lxml/includes
copying src/lxml/includes/htmlparser.pxd -> build/lib.linux-x86_64-2.6/lxml/includes
copying src/lxml/includes/xslt.pxd -> build/lib.linux-x86_64-2.6/lxml/includes
copying src/lxml/includes/xmlschema.pxd -> build/lib.linux-x86_64-2.6/lxml/includes
copying src/lxml/includes/xmlerror.pxd -> build/lib.linux-x86_64-2.6/lxml/includes
copying src/lxml/includes/schematron.pxd -> build/lib.linux-x86_64-2.6/lxml/includes
copying src/lxml/includes/dtdvalid.pxd -> build/lib.linux-x86_64-2.6/lxml/includes
copying src/lxml/includes/lxml-version.h -> build/lib.linux-x86_64-2.6/lxml/includes
copying src/lxml/includes/etree_defs.h -> 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 -> 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 -> build/lib.linux-x86_64-2.6/lxml/isoschematron/resources/xsl
copying src/lxml/isoschematron/resources/xsl/RNG2Schtrn.xsl -> 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 -> 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 -> 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 -> 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 -> 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 -> 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 -> 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 <http://bugzilla.redhat.com/bugzilla> 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/
答案 0 :(得分:0)
解决方案是运行:
yum install python-lxml
答案 1 :(得分:0)
我的解决方案是运行:
[values]