10

I'm trying to install libxml2 since I came to know this is dependency for lxml. Facing issues like:

Could not find dependencies

Any idea how to install libxml2?

My python version is 3.5.2.

Amal Murali
  • 75,622
  • 18
  • 128
  • 150
Pradhaban
  • 664
  • 2
  • 6
  • 22

1 Answers1

17

Official documentation has the installation steps for Linux, Mac OS and Windows.

To install lxml on Ubuntu, you first will need to install the binary dependencies:

sudo apt-get install libxml2-dev libxslt-dev python-dev

Then you will be able to install lxml using pip:

pip install lxml

You cannot install libxml or libxslt using pip as they are not Python packages.

Amal Murali
  • 75,622
  • 18
  • 128
  • 150
NickAb
  • 6,337
  • 3
  • 15
  • 18
  • To install it on non-Ubuntu Linux systems, check the comments on this answer: https://stackoverflow.com/a/35872362/4995840 – A N Dec 10 '19 at 19:28