• Register
0 votes

Problem :

I am facing following error “Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?” when I am trying to install the lxml through pip.

The detailed error message as below :

c:\users\alecxe\appdata\local\temp\xmlXPathInitqjzysz.c(1) : fatal error C1083: Cannot open include file: 'libxml/xpath.h': No such file or directory 
Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed? 
error: command 'C:\\Users\\alecxe\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\cl.exe' failed with exit status 2

I am unable to find any of the libxml2 dev packages to be installed via pip.

I am currently using Python 2.7.10 on x86 in a virtualenv under my Windows 10.

6 5 3
7,540 points

1 Answer

0 votes

Solution :

I had faced this issue in recent past and I realized that while I did have libxml2 installed, I didn't had the necessary dev libraries required for the python package. Just installing them solved my problem.

Please install below libraries as shown below :

sudo apt-get install libxml2-dev libxslt1-dev
sudo pip install lxml




You can install the lxml from the http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml for the python version. These are the precompiled WHL with required modules/dependencies for you.

This site lists many packages e.g. by using Win32 Python 2.7, please use lxml-3.6.1-cp27-cp27m-win32.whl.

You can download the file, and then install it with below command.

pip install C:\path\to\downloaded\file\lxml-3.6.1-cp27-cp27m-win32.whl
9 7 4
38,600 points

Related questions

0 votes
1 answer 164 views
Problem : Currently I am learning Ionic I have recently created the ionic 2 project and also added the diagnostic cordova plugin as below: ionic plugin add cordova.plugins.diagnostic npm install --save @ionic-native/diagnostic and after that added the android platform as ... system to install the gradle wrapper. Please include gradle in your path, or install Android Studio How to fix above error?
asked Feb 26 mphil 2.3k points
1 vote
1 answer 226 views
Problem: I was trying some code in python using pytesseract but it shows the error message: Pytesseract : TesseractNotFound Error: tesseract is not installed or it's not in your path I wrote the code: from PIL import image import pytesseract ig = image.open( myself.jpg ) ... ig, lang='eng') print(setup) I instaled pytesseract but it is not showing now and how can I fix this problem please help.
asked Apr 24 samhaz 5k points
0 votes
1 answer 4.9K views
Problem : I am getting following error: pytesseract.pytesseract.tesseractnotfounderror: tesseract is not installed or it's not in your path
asked Nov 7, 2019 peterlaw 6.9k points
0 votes
1 answer 81 views
Problem : I want to intstall the TensorFlow using pip. I tried below command: $ pip install tensorflow –user But I got below error: Collecting tensorflow Could not find a version that satisfies the requirement tensorflow (from versions: ) No matching distribution found for tensorflow How can I install the TensorFlow?
asked Feb 19 mphil 2.3k points