** make sure the development packages of libxml2 and libxslt are installed **
From the lxml documentation, assuming you are running a Debian-based distribution :
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 python-lxml
or python3-lxml
, e.g.
sudo apt-get install build-dep python3-lxml