user1106278 user1106278 - 1 year ago 74
Linux Question

How do I install lxml in linux without using aptitude or apt-get

I'm running ubuntu 12.04 and usually use python 2.7, but I need a python package that was built with python 3.4 and that uses lxml. After updating aptitude, I can install python 3.2 and lxml, but the package I want only works with 3.4. After installing python 3.4, I try to install lxml dependencies using

pip3 install libxml2-dev

I get the error:

No matching distribution found for libxml2-dev

pip3 install lxml

doesn't work and asks for libxml2:

Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?

Any ideas on how to install lxml? Thanks.

Answer Source

You are running

pip3 install libxml2-dev

when you should be running

sudo apt-get install libxml2 libxml2-dev

(you may also need libxslt and its dev version as well)

pip doesn't install system libraries, apt and friends do that.