Question Details

Browse

Installing libxml2 on the mac

By Peter fink - Dec. 03, 2007

Hello. I have a python script that requires libxml2 import. I cannot find the libxml2 package on the default mac python installation. Where can I get it from? I did not find it on python.org. Maybe I didn't look in the right places?


Answers

Add Answer
  1. By jeremy koempel on Dec. 03, 2007

    Hello Peter, I ran across this link which may be the solution: http://py-libxml2.darwinports.com/ Cheers.

    1 Votes
  2. By Alex Martelli on Apr. 23, 2008

    If you have gcc installed (comes as part of Apple's XCode), the sources for the Python bindings for the various versions of libxml2 can all be downloaded from ftp://xmlsoft.org/libxml2/python/ . I believe the libxml2 version that comes with MacOSX is 2.6.16 (for either Leopard or Tiger, something older if you're stuck on Panther); that exact version is not supported but 2.6.15 should (I believe) be close enough, so download ftp://xmlsoft.org/libxml2/python/libxml2-python-2.6.15.tar.gz , tar xzf it, cd, python setup py install (will give you a few warnings but I believe it will work correctly). That's how one normally goes about downloading and installing Python extensions distributed as sources (you need gcc, and thus xcode, if and only if the sources include some C sources).


    HTH,


    Alex


    0 Votes
Share your knowledge