Hi All,


I get the following errors when trying to install on OSX:


In file included from src/lxml/lxml.etree.c:320:
    src/lxml/includes/etree_defs.h:14:10: fatal error: 'libxml/xmlversion.h' file not found
    #include "libxml/xmlversion.h"
    1 error generated.
    Compile failed: command '/usr/bin/clang' failed with exit status 1
    creating tmp
    cc -I/usr/include/libxml2 -I/usr/include/libxml2 -c /tmp/xmlXPathInitoThBAU.c -o tmp/xmlXPathInitoThBAU.o
    /tmp/xmlXPathInitoThBAU.c:1:10: fatal error: 'libxml/xpath.h' file not found
    #include "libxml/xpath.h"
    1 error generated.
    Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?
    Perhaps try: xcode-select --install
    error: command '/usr/bin/clang' failed with exit status 1
Command "/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-build-iwRU7A/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-yHDGqc-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/tmp/pip-build-iwRU7A/lxml/



any hints?



Hi Jack,


Firstly we'd highly recommend using Anaconda python rather than standard python on Mac OS X. Anaconda comes with many packages pre-installed, like lxml which appears to be the package you're having trouble with here.


That said, as the error message suggests, installing xcode from the apple store then running "xcode-select --install" from a terminal window should help ensure the required libraries are installed.



Thanks Dave,

updating xcode fixed the problem - must have forgotten to do it when moving to El Capitan.




You must be signed in to post in this forum.