A lot of pain went into it for the outdated 10.6.8 os x, but here it goes for everyone who works with Snow Leopard!
First you need to install another version of libxml2 from homebrew and install --with-python. You can do this by entering the following commands.
brew update brew edit libxml2
Then find the line that says "--without-python" and change it to "--with-python".
system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}", "--with-python"
Now you can install libxml2.
brew install libxml2
Next, check the new installation of libxml2 at the default source location. You want to find the libxml2 configuration.
YOURS MAY BE DIFFERENT:
"/ USR / local / Footer / libxml2 / VERSION_ / bin / xml2 configurations"
Now use the following command to install lxml using pip using the recently installed libxml2 configuration, not the Mac OS X version.
ARCHFLAGS="-arch i386 -arch x86_64" pip install lxml --install-option="--with-xml2-config=/usr/local/Cellar/libxml2/2.9.1/bin/xml2-config"
Worked for me on my 10.6.8 Python 2.6. Thank you
Credit goes to this page to show me pip -install-option ...
http://natanyellin.com/page/4/
ganicus Jul 03 '14 at 0:55 2014-07-03 00:55
source share