• Register
0 votes
1.8k views

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

 

OR

 

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 12 views
12 views
Problem : I am facing following error: “Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?”
asked Mar 14 Wafa Abu Yousef 6.1k points
0 votes
0 answers 4 views
4 views
Problem: it gives me the error OSError: Could not find libspatialindex_c library file has anyone encountered this before? my script was working just fine until this error came up.
asked Apr 2 ummesalma 25.2k points
1 vote
1 answer 4 views
4 views
Solution: Can some one fix this ? Could not find function "read.xlsx".
asked Mar 20 PkGuy 13.1k points
0 votes
1 answer 2 views
2 views
Problem: Please let me know any solution regarding this .. The headers or library files could not be found for jpeg
asked Apr 7 Ifra 24.4k points
0 votes
1 answer 290 views
290 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
0 votes
0 answers 3 views
3 views
Problem: As I mentioned in my previous query, I'm having difficulties with my learning; I've tried searching the web but haven't been able to find adequate information; could you assist me in continuing my project?
asked Mar 29 tuhin1 48.9k points
0 votes
1 answer 11 views
11 views
Problem: I am a new programmer and I need your help. I'm pretty much new to Atom editor but set up some nice packages like Atom Beautify. I did install the package PHP-cs-fixer but nothing happens. Could not find 'php-cs-fixer'. the program may not be installed. Anyone got an idea how I can fix this?
asked Feb 25 Umar Ahmad 4.1k points
1 vote
1 answer 26 views
26 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
0 votes
1 answer 5 views
5 views
Problem: As I mentioned in my previous query, I'm having difficulties with my learning; I've tried searching the web but haven't been able to find adequate information; could you assist me in continuing my project?
asked Mar 29 tuhin1 48.9k points