[lxml-dev] Using, or building, lxml in Windows with Cygwin

David Antliff david.antliff at gmail.com
Tue Jun 16 23:22:17 CEST 2009


On Tue, Jun 16, 2009 at 18:46, Stefan Behnel <stefan_ml at behnel.de> wrote:
>
> David Antliff wrote:
> > I am trying to get the Windows lxml egg to work with Cygwin, Python 2.5.2
> > on WindowsXP, 32bit. I wasn't able to find a Cygwin package for lxml so
> > I felt I needed to obtain or build a win32 version of lxml. I want to
> > use the xpath
> > functionality that lxml provides in python scripts, running in Cygwin.
> >
> > *** All commands below are issued in a Cygwin bash shell ***
>
> Any reason why you use the Cygwin Python installation instead of a normal
> Windows build?

The situation is that I'm maintaining a build environment for FPGA
tools. The users are hardware engineers with little experience in
software issues. We use Cygwin because it provides GNU make, python,
perl, and a bunch of other GNU things. The main problem is that the
environment is already deployed and I want to avoid requiring people
to manually update their Cygwin installation to bring in an lxml
library. Actually, there doesn't even seem to BE a Cygwin lxml
library.

I have written a program as part of a new process in our build system
that does a lot of XML processing. I was using ElementTree but it's
falling short in several areas. Lxml looks like a good solution. So my
thinking was that I could bundle the lxml egg with the next version of
the build system and nobody would need to manually intervene. As it
stands, there's also a need to install setuptools but this can be done
easily and automatically.

Do you think the binary egg provided on the web does not work because
I'm using a different version of Python (Cygwin, rather than Windows
native) with it?

If possible, I want to avoid switching to the Windows native python
because nobody else has it installed.

> I never tried building lxml on Windows myself, but with Cygwin, you may
> get away with installing the developer packages of libxml2 and libxslt, or
> with simply passing "--static-deps" as described for the MacOS build.
> MinGW should work, but you need to configure it in your distutils.cfg:
>
>  [build]
>  compiler=mingw32
>
> http://docs.python.org/install/index.html#location-and-names-of-config-files
>
> If you get it to work, please report anything you had to do to the list.
> Or even better: write a little section for this file:
>
> http://codespeak.net/svn/lxml/trunk/doc/build.txt
>
> Please ask back if you run into further problems.

I'll give this a try - thank you very much.

Regards,

-- David.


More information about the lxml-dev mailing list