How to install libxml2-dev libxslt-dev on Mac os

2019-04-10 04:01发布

问题:

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?

回答1:

Try adding STATIC_DEPS, like this

STATIC_DEPS=true sudo pip install lxml



回答2:

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.