我正在尝试在我的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
我正在使用Python 2.7.3版本,并且已经尝试安装libxml2-dev libxslt1-dev python-dev但我已经在我的系统中安装了这些。
有什么想法吗?
答案 0 :(得分:0)
pip install lxml
另外,您可以尝试:
$ sudo apt-get install python-lxml