[Solved - 5 Solutions] pip install lxml error



Error Description:

  • ERROR binsh xslt-config not found: make sure the development packages of libxml2 and libxslt are installed.

Solution 1:

Make sure the development packages of libxml2 and libxslt are installed

  • Assuming we are running a Debian-based distribution
sudo apt-get install python-dev libxml2-dev libxslt1-dev zlib1g-dev 
click below button to copy the code. By - python tutorial - team
  • If we're installing for Python 3 on Debian-based distributions, we'll want to install python3-devtoo.

Solution 2:

  • In case, we are using Ubuntu/Lubuntu 13.04 or Ubuntu 13.10 and having problem with "/usr/bin/ld: cannot find -lz", we may need to also install zlib1g-dev package:
sudo apt-get install -y zlib1g-dev 
click below button to copy the code. By - python tutorial - team
  • Put it all together:
sudo apt-get install -y libxml2-dev libxslt1-dev zlib1g-dev python3-pip
sudo pip3 install lxml 
click below button to copy the code. By - python tutorial - team

Solution 3:

  • We can solve this issue by increasing our server ram.
  • We can also install every package manually prior to this in an attempt to fix the problem, but it’s not a necessary step.

Solution 4:

  • We can solve it by installing the wheel and running pip from the Python34 directory.
 cd Python34\Scripts
 pip.exe C:\Users\Home\Downloads\lxml- ......... .whl 
click below button to copy the code. By - python tutorial - team

Solution 5:

  • If we have installed the libxml2 and libxslt, we need to create a symbolic link between libxml2 and libxslt path to python2.6 include path. Also we can try to add INCLUDE environment argument. Because the gcc command only search this path: -I/usr/include/python2.6.

Related Searches to pip install lxml error