Getting "Could not find xmlCheckVersion function in libxml2 library. Is libxml2 installed?" when installing lxml via pip

When I try to install lxml via pip, I get the error Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed? Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed? .

  c:\users\f\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\\f\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\cl.exe' failed with exit status 2 

I can not find libxml2 dev packages to install via pip.

Using Python 2.7.10 on x86 in virtualenv on Windows 10.

+90
python
Nov 18 '15 at 16:49
source share
9 answers

Install lxml from http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml for your python version. This is a precompiled WHL with the necessary modules / dependencies.

The site lists several packages, for example, using Win32 Python 2.7, use lxml-3.6.1-cp27-cp27m-win32.whl .

Download the file and then install using

 pip install C:\path\to\downloaded\file\lxml-3.6.1-cp27-cp27m-win32.whl 
+95
Nov 18 '15 at 16:49
source share

I had this problem and realized that although I already had libxml2 installed, I did not have the necessary development libraries needed for the python package. Their installation solved the problem:

 sudo apt-get install libxml2-dev libxslt1-dev sudo pip install lxml 
+141
Mar 08 '16 at 16:12
source share

Try using:
easy_install lxml
This works for me, win10, python 2.7.

+33
Dec 23 '15 at 10:35
source share

On Mac OS X El Capitan, I had to run these two commands to fix this error:

 xcode-select --install pip install lxml 

Who completed the installation of lxml-3.5.0

When you run the xcode-select command, you may need to sign an EULA (so X-Term will be convenient for the user interface if you do this on a headless machine).

+23
Jan 15 '16 at 17:09
source share

If anyone else has the same problem as on

Centos, try:

 yum install python-lxml 

Ubuntu

 sudo apt-get install -y python-lxml 

worked for me.

+20
May 26 '16 at 13:24
source share
 set STATICBUILD=true && pip install lxml 

run this command instead, the VS C ++ compiler must be installed first

https://blogs.msdn.microsoft.com/pythonengineering/2016/04/11/unable-to-find-vcvarsall-bat/

This works for me with Python 3.5.2 and Windows 7

+5
Dec 23 '16 at 1:52
source share

I tried installing lib which depends on lxml and nothing works. When the assembly starts, the message “Build without Cython” appears, so after installing cython using apt-get install cython lxml was installed.

0
May 03 '18 at 23:37
source share

for Windows users go to https://www.zlatkovic.com/pub/libxml/ download the libxml2 file

unpack it

Files in this package do not require any special installation steps. Extract the contents of the archive wherever you want and make sure your tools using libxml2 can find it.

0
Jan 18 '19 at 9:38
source share

It’s not strange for me that none of the above solutions worked, but I saw how the igd installation uninstalled the new version and installed the old one, for the solution I downloaded this archive: https://pypi.org/project/IGD/# files

and changed the recommended version of the new version: 'lxml == 4.3.0' in setup.py It works!

0
Jan 31 '19 at 18:01
source share



All Articles