简体   繁体   中英

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:

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.

Any idea?

Did you try pip? Generally pip should be preferred over easy_install:
Why use pip over easy_install?
Corresponding pip command will be

pip install lxml

Also, you can try:

$ sudo apt-get install python-lxml

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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