8

I have installed both libxml2 and libxslt with homebrew, but it doesn't want to install libxml2-dev or libxslt-dev: Error: No available formula for libxml2-dev

I have pip, port, and all I could found. I even installed the Xcode command line tools, but with no luck. What is the way to install libxml2-dev & libxslt-dev on Mac 10.10?

Parker
  • 8,539
  • 10
  • 69
  • 98
Coderbit
  • 701
  • 3
  • 9
  • 31
  • Do you have xcode command line tools installed? – Parker Oct 20 '14 at 23:29
  • @Parker yes, I do `xcode-select -p /Applications/Xcode.app/Contents/Developer` – Coderbit Oct 21 '14 at 06:32
  • 1
    run `xcode-select --install` to check if command line tools are installed. `xcode-select -p /Applications/Xcode.app/Contents/Developer` does not tell if command line tools are installed. – ndreisg Jul 14 '17 at 07:33

2 Answers2

12

Try adding STATIC_DEPS, like this

STATIC_DEPS=true sudo pip install lxml

Parker
  • 8,539
  • 10
  • 69
  • 98
  • 2
    Great to hear :). This sometimes occurs with other libs so if you ever have a similar issue, try this again – Parker Oct 22 '14 at 07:39
  • So, `libxml2-dev` is not installed with `Homebrew` and rather with the command above? – mhyousefi Oct 13 '19 at 07:35
  • 1
    Unfortunately, it does not work solve the problem for me (Mac OS X Sierra 10.12.6) – Andrea Salicetti Nov 27 '19 at 08:15
  • I dont know what sorcery is that, but that's the only thing that helped after installing all dependencies and still failing to install xmlsec on Mac M1 silicon – Ilja Leiko Sep 15 '22 at 06:28
0

I had the same problem and installing the Command Line Tools fixed the problem for me.

I just wanted to note, that calling xcode-select -p and getting the output /Applications/Xcode.app/Contents/Developer does not tell if Xcode Command Line Tools are installed (like stated in the comments on the question)!

For me it returned the same output but xcode-select --install started the installation. After the installation xcode-select --install printed xcode-select: error: command line tools are already installed, use "Software Update" to install updates

So to check if command line tools are installed better use xcode-select --install.

ndreisg
  • 1,119
  • 13
  • 33