Installing lxml python on Mac OSX

libxml is swiss army knife for xml parsing on python. It implement libxml2 and libxslt C library for python

Before you fire the python setup

you have to change your default compiler from gcc 4.2 to gcc 4.0. This can be done by removing the symlink file in /usr/bin/gcc and re-linking that to gcc-4.0. This can be done by doing:

sudo rm /usr/bin/gcc
sudo ln -s /usr/bin/gcc-4.0 /usr/bin/gcc
cd /tmp
tar -xzvf lxml-2.3.4.tgz 
cd lxml-2.2.2
mkdir libs; cd libs/
cd ..
python build --static-deps --libxml2-version=2.7.3  --libxslt-version=1.1.24 
sudo python install

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s