Search code examples
pythonmacososx-snow-leopardlibxml2

Using built-in libxml2 on Mac 10.6.x


I understand that Mac OS 10.6.x contains a built-in version of libxml2.

I feel pretty stupid here, but then why doesn't this work?

python -c "import libxml2"

Is there some step I'm missing that makes the library accessible in Python?

which python

...returns:

/usr/bin/python2.6 -> ../../System/Library/Frameworks/Python.framework/Versions/2.6/bin/python2.6

... so it looks to me like I'm using the default python.

I was able to find lots of older instructions for installing new versions of libxml2 on older versions of Mac OS, but nothing about just using what it comes with on 10.6.x. I prefer to use the built-in stuff instead of MacPorts if possible.


Solution

  • Here is a post that explains how to install libxml2 for python on OS X: http://lsimons.wordpress.com/2008/08/31/how-to-install-lxml-python-module-on-mac-os-105-leopard/