How to install libxml2 2.9.0 for lxml for Python 3

2019-08-04 01:56发布

问题:

I'm using lxml 3.4.2 for Python 3.4 on a win 7 64 computer. I got lxml from http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml. One of its parts is libxml2 2.9.2. I'm having a problem that a user of lxml 3.4.2 with libxml2 2.9.0 is not having, so I'd like to try libxml2 2.9.0, but can't figure out how to install it. See Python 2 v. 3 xpath for more on the problem.

I don't have the ability to compile from sources. How can I install 2.9.0?

回答1:

To use custom versions, you will almost certainly have to build lxml by hand using the appropriate version of libxml. The lxml website has some information on how to build their package:

  • http://lxml.de/installation.html

You will need to make sure you have the correct version of Visual Studio Express installed for Python 3.4 to build lxml in a way that is compatible to that version of Python. According to this, you'll want Visual Studio 2010.