0

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.

user1106278
  • 647
  • 1
  • 9
  • 16

2 Answers2

3

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.

MattDMo
  • 90,104
  • 20
  • 213
  • 210
  • sudo apt-get install libxml2... installs libxml2 for either python 2.7 or 3.2 which are supported by apt-get. I need libxml2 for python 3.4. – user1106278 Aug 05 '16 at 20:18
  • 1
    @user1106278 I think you misread the answer. You need to have libxml2-dev installed (`sudo apt-get install libxml2-dev`) before you can install lxml with `pip3 install lxml`. – pah Aug 05 '16 at 20:52
0

See http://www.lfd.uci.edu/~gohlke/pythonlibs/#libxml-python

Download the package and then do a pip install <package.whl>.

SaeX
  • 13,326
  • 14
  • 67
  • 86