简体   繁体   English

在Ubuntu 10.04.4上安装lxml时出现问题

[英]Issue installing lxml on Ubuntu 10.04.4

I am trying to install "lxml" on my Ubuntu 10.04.4 and getting the following error: 我正在尝试在Ubuntu 10.04.4上安装“ lxml”,并得到以下错误:

root@buildxxxx:~# easy_install lxml
install_dir /usr/lib/python2.7/site-packages/
Searching for lxml
Reading http://pypi.python.org/simple/lxml/
Best match: lxml 3.4.4
Downloading https://pypi.python.org/packages/source/l/lxml/lxml-    3.4.4.tar.gz#md5=a9a65972afc173ec7a39c585f4eea69c
Processing lxml-3.4.4.tar.gz
Running lxml-3.4.4/setup.py -q bdist_egg --dist-dir /tmp/easy_install- hswCIi/lxml-3.4.4/egg-dist-tmp-D4CPP_
Building lxml version 3.4.4.
Building without Cython.
Using build configuration of libxslt 1.1.26
Building against libxml2/libxslt in the following directory: /usr/lib
/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'bugtrack_url'
warnings.warn(msg)
src/lxml/lxml.etree.c:16:20: error: Python.h: No such file or directory
src/lxml/lxml.etree.c:18:6: error: #error Python headers needed to compile C    extensions, please install development version of Python.
error: Setup script exited with error: command 'gcc' failed with exit status 1

I am using Python 2.7.3 version and already tried installing libxml2-dev libxslt1-dev python-dev but I already had these in my system. 我正在使用Python 2.7.3版本,并且已经尝试安装libxml2-dev libxslt1-dev python-dev,但是我已经在系统中安装了这些文件。

Any idea? 任何想法?

Did you try pip? 你尝试点子了吗? Generally pip should be preferred over easy_install: 通常,pip应该比easy_install更可取:
Why use pip over easy_install? 为什么要在easy_install上使用pip?
Corresponding pip command will be 相应的pip命令将是

pip install lxml

Also, you can try: 另外,您可以尝试:

$ sudo apt-get install python-lxml

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM