Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'd like to use etree, expat or similar, though I understood etree is easier to use. But how do I install that when I already have Python 2.7.2 installed on Ubuntu 11.10?

All documentation I can find through Google suggests that xml parsing is available by default for Python. Or at least when I search for install xml parser python, or any combination of similar words, also including etree or expat I can't find what steps to take (a commandline install method).

share|improve this question
up vote 5 down vote accepted

You are probably looking for something like lxml.

Please have a look at the lxml webpage

You can install it in ubuntu with

sudo apt-get install python-lxml
share|improve this answer
This will work for me. I already tried sudo apt-get install python-xml. Just one letter off from a solution... – Ruud Nov 26 '11 at 8:50
One thing I should mention. I did have to follow the installation instructions from the webpage. After just sudo apt-get install python-lxml Their test script still failed for me... – Ruud Nov 28 '11 at 22:58

If you're looking for etree, you don't need to install anything, it's available in xml.etree.ElementTree.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.