Search code examples
pythonmacoslibxml2

Libxml2 installation onto Mac


I'm trying to install "libxml2" and "libxslt" in order to use scrapy (web scraping with python) on a mac.

I have homebrew and I ran $ brew install libxml2 libxslt

I get this message OS X already provides this software and installing another version in parallel can cause all kinds of trouble.

When I try to instal scrapy, using $ pip install scrapy

I get this error:

Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?
    Perhaps try: xcode-select --install

When I try $ xcode-select libxml2 install I get an invalid argument error.

Any suggestions?


Solution

  • You should run $ xcode-select --install. This will install the XCode command line tools which include libxml2.