Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pip install error missing 'libxml/xmlversion.h'

I need to install the python package xmlsec(https://pypi.python.org/pypi/xmlsec) and when I try running

pip install xmlsec

It gives me this error:

src\xmlsec\constants.c(266) : fatal error C1083: Cannot open include file: 'libxml/xmlversion.h': No such file or directory

When I first researched this error I found numerous answers that it had to do with the installed lxml package. After trying:

pip install --upgrade lxml

It wasn't able to upgrade and so I uninstalled lxml and installed it again but there was an IO error. In the end I downloaded the lxml file from http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml and placed it in my python directory and installed it as the answer from this question did: Installing lxml, libxml2, libxslt on Windows 8.1

It uploaded successfully and when running pip upgrade, it says it is up to date.

The same error though still persists from trying to install xmlsec though with 'libxml/xmlversion.h' missing. Does anyone know what else can be the problem here?

Note: I'm using python 2.7 on windows

like image 380
clue3434 Avatar asked Aug 11 '16 23:08

clue3434


1 Answers

You may need to install the header files for libxml and libxml-sec. You do not indicate which platform you are running on. If you run on ubuntu you need to sudo apt-get install libxml2-dev libxmlsec1-dev.

like image 96
Hans Then Avatar answered Sep 21 '22 13:09

Hans Then