• 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

Please log in or register to answer this question.

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 236 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, 2020 mphil 2.3k points
1 vote
1 answer 296 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, 2020 samhaz 5k points
0 votes
1 answer 5.8K 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 21 views
I am struggling with Jetson TX2 board (aarch64). I need to install python wrapper for OpenCV. I can do: $ sudo apt-get install python-opencv But I cannot do: $ sudo pip install opencv-python Is this because there is no proper wheel file in http://www.lfd.uci.edu/~gohlke/pythonlibs/#opencv ? Is there a way to install opencv-python through pip?
asked Oct 25, 2020 psandprop 2.4k points
0 votes
1 answer 130 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, 2020 mphil 2.3k points
0 votes
1 answer 135 views
Problem : When I try to install PyGame with:pip install pygame i am getting below error python could not find a version that satisfies the requirement
asked Oct 22, 2019 peterlaw 6.9k points
0 votes
1 answer 37 views
Problem: I have basic knowledge of python, anaconda, plotly and msgpack. Now I am facing a problem while trying to install the plotly. I proceeded to upgrade my anaconda using a command line on a Debian 9 but unfortunately I received an error message saying: " ... .0 error message stopped my whole upgrading process of many of the packages. pip install msgpack does not really fix the above problem.
asked Aug 27, 2020 Raphael Pacheco 4.9k points
0 votes
1 answer 78 views
I understand the questions but the thing that im not sure about is the part it says "using functions". here is my code and wonder if its acceptable; x= int(input("Enter first number:")) y= int(input("Enter second number:")) sum=x+y average=sum/2 print("Sum of the given two numbers is:", sum) print("Average of the given numbers is:", average)
asked Oct 28, 2020 psandprop 2.4k points
1 vote
1 answer 25 views
Problem : Recently I have started learning Homebrew. Now if I try to run Homebrews brew doctor command on my Mac OS X 10.9.2 I have started receiving the below listed warning message: Warning: Python is installed at /Library/Frameworks/Python.framework Homebrew only ... /usr/local/bin/python. But still if I rerun the brew doctor command I am still facing the same warning message listed above.
asked Apr 4, 2020 morrisBson 3.2k points