How do I install libxml2 and libxslt?

Nat Williams nat.williams at
Mon Nov 2 19:06:09 CET 2009

On Mon, Nov 2, 2009 at 9:41 AM, Kevin Ar18 <kevinar18 at> wrote:

>  I want to use the lxml library, but can't get it to work on Windows.
> The following will not work:
> * import libxml2
> * import libxslt
> * from lxml import etree
> Here's the instructions:
> * So, I run "easy_install lxml" -- that works!
> * Now, it says I need to install libxml2 and libxslt... how do I do that?
>, I download the libxml2 and libxslt pre-built Windows binaries here:
> Now what do I do with them?
> I opened the zip files and copied the bin directories to Python\Lib ...
> like this: Python\Lib\libxml2\libxml2.dll ... that doesn't work. I copy just
> dll to Python\DLLs ... that doesn't work.
> What now?

According to the lxml installation instructions you linked, the windows lxml
binary is statically linked and you do not need to install the libraries
separately.  If 'from lxml import etree' works, then you're done.

libxml2 and libxslt are C libraries, not things that you can or would
import.  The joy of lxml is not having to deal with those libraries on your

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list