1

I am using cygwin for python. I am not able to install lxml as it is showing some library missing error.

 creating tmp
 cc -I/usr/include/libxml2 -c /tmp/xmlXPathInit94yfjj.c -o 
 tmp/xmlXPathInit94yfjj.o
 /tmp/xmlXPathInit94yfjj.c:1:10: fatal error: **libxml/xpath.h: No such file 
 or directory**
 #include "libxml/xpath.h"
        ^~~~~~~~~~~~~~~~
 compilation terminated.


 Could not find function xmlCheckVersion in library libxml2. Is libxml2  
 installed?

 ***error: command 'gcc' failed with exit status 1***


 Failed building wheel for lxml
 Running setup.py clean for lxml
 Failed to build lxml
 Installing collected packages: lxml
 Running setup.py install for lxml ... error
 Complete output from command 
 /cygdrive/c/Users/1419104/Torutils/env/bin/python -u -c "import setuptools, 
 tokenize;__file__='/tmp/pip-install-
 3aL8Ib/lxml/setup.py';f=getattr(tokenize, 'open', open)
 (__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, 
 __file__, 'exec'))" install --record /tmp/pip-record-driSho/install-
 record.txt --single-version-externally-managed --compile --install-headers 
 /cygdrive/c/Users/1419104/Torutils/env/include/site/python2.7/lxml:
 Building lxml version 4.3.2.

Could someone please do help?

phd
  • 82,685
  • 13
  • 120
  • 165
Jagan
  • 41
  • 4
  • Possible duplicated: https://stackoverflow.com/questions/33785755/getting-could-not-find-function-xmlcheckversion-in-library-libxml2-is-libxml2 – R. García Mar 19 '19 at 09:46
  • Still no solution for me. I could not able to install any library libxslt and libxml2 as well. Getting error like "ERROR: /bin/sh: xslt-config: command not found" while doing "easy_install lxml" – Jagan Mar 19 '19 at 10:47
  • https://anythingsimple.blogspot.com/2010/04/install-lxml-on-cygwin.html – phd Mar 19 '19 at 20:28
  • Try: `apt-cyg install libxml2-devel` – pguardiario Mar 20 '19 at 00:33

1 Answers1

0

You are missing the devel package of libxml2

 $ cygcheck -p libxml/xpath.h
Found 7 matches for libxml/xpath.h
libxml2-devel-2.9.3-1 - libxml2-devel: GNOME XML library (development) (installed binaries and support files)
libxml2-devel-2.9.4-1 - libxml2-devel: GNOME XML library (development) (installed binaries and support files)
libxml2-devel-2.9.4-2 - libxml2-devel: GNOME XML library (development)
...

The proper way to install the libxml2-devel package is to use the cygwin setup program

matzeri
  • 8,062
  • 2
  • 15
  • 16
  • @not2qubit from https://cygwin.com/packages/package_list.html you see that python37-lxml exists but the 38 does not yet. – matzeri Oct 16 '19 at 08:46