I've tried this and run in to problems a bunch of times in the past. Does anyone have a recipe for installing lxml on OS X without MacPorts or Fink that definitely works?
Preferably with complete 1-2-3 steps for downloading and building each of the dependencies.
In case you want to use the current in-development version of lxml, you can get it from the github repository at https://github.com/lxml/lxml . Note that this requires Cython to build the sources, see the build instructions on the project home page.
To build lxml from source, you need libxml2 and libxslt properly installed, including the header files. These are likely shipped in separate -dev or -devel packages like libxml2-dev, which you must install before trying to build lxml.
Unless you are using a static binary distribution (e.g. from a Windows binary installer), lxml requires libxml2 and libxslt to be installed, in particular: libxml2 version 2.9. 2 or later.
the following way worked for me: tap the main menu button (3 horizontal stripes in top left corner) tap on "Pip" in the dropdown menu tap on the "INSTALL"-tab enter "lxml" in the input line tap on the "INSTALL" button then the installation should run when ready, and there was no error message, go to "Interpreter" in ...
Thanks to @jessenoller on Twitter I have an answer that fits my needs - you can compile lxml with static dependencies, hence avoiding messing with the libxml2 that ships with OS X. Here's what worked for me:
cd /tmp curl -O http://lxml.de/files/lxml-3.6.0.tgz tar -xzvf lxml-3.6.0.tgz cd lxml-3.6.0 python setup.py build --static-deps --libxml2-version=2.7.3 --libxslt-version=1.1.24 sudo python setup.py install
This worked for me (10.6.8):
sudo env ARCHFLAGS="-arch i386 -arch x86_64" easy_install lxml
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With