0

I'm trying to install lxml for python using pip. I have tried sudo pip install lxml and sudo pip install lxml both of these give the error:

Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?
    Perhaps try: xcode-select --install
    *********************************************************************************
    error: command 'cc' failed with exit status 1

No idea what is going on here. Who is Xcode getting involved? Any pointers would be really appreciated.

Bhargav Rao
  • 50,140
  • 28
  • 121
  • 140
Kex
  • 8,023
  • 9
  • 56
  • 129
  • Have you used `xcodebuild -license` to accept the Xcode licence? Without this clang/clang++ will not run. Or have you even installed the command line tools? – donkopotamus Nov 30 '15 at 08:28
  • Why do I have to accept an Xcode licence for a Python module? (Just accepted it now). I don't have command line tools installed. Do you mean the Xcode command line tools? – Kex Nov 30 '15 at 09:28
  • While lxml is a "python module", it is not written purely in python. It needs to be compiled ... so you need a c-compiler ... so you probably want the Xcode command line tools. – donkopotamus Nov 30 '15 at 10:03
  • Got it. Works now. thanks for your help. – Kex Nov 30 '15 at 11:34

0 Answers0