Installing lxml on 10.9

January 17, 2014

That’s because 10.9 doesn’t come with libxml, but rather libxml2. Luckily the latter also includes the headers for libxml under

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/libxml2/libxml

So we can easily solve the problem by modifying our pip command:

$ CPATH=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/libxml2 pip install -U lxml