Pip Install LXML Error

When I running sudo pip install lxml, a error occur says I need to install libxml2 and libxslt. After looking up online, I found the resolution for that problem.

Install lxml using pip

Where to get it

1. linux

python 2

sudo apt-get install python-lxml

python 3

sudo apt-get install python3-lxml

2. Mac

sudo port install py27-lxml


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

For Debian based systems, it should be enough to install the known build dependencies of the provided lxml package, e.g.

sudo apt-get build-dep python3-lxml


sudo pip install lxml