Sunday, April 04, 2010

Install lxml on Cygwin

To install lxml on Cygwin you need jump through a few hoops, to save who wants to get it done smoothly, I write down the necessary steps:
  • Make sure install the following package for cygwin by using Cygwin setup libxml2, libxml2-devel, libxslt, libxslt-devel, python-libxml2, python-libxslt
  • If you got lots of errors about debug format:
    • try to add -gdwarf-2 to CFLAGS
      • export CFLAGS="-gdwarf-2"

3 comments:

kees said...

This might be a dumb question, but were you able to successfully build lxml from source within cygwin?

Brian said...

worked great for me, but your dependencies should be libxslt instead of libxlst

drunkenfilosofer said...

Worked great for me - I found this after realizing that the "Warning: .stabn: description field XXXX too big" errors were coming from the lxml install step in the Scrapy download, and setting your suggested CFLAG did the trick for me.