farm-haystack with FAISS on Mac (Monterey)

467 Views Asked by At

I had a hard time installing farm-haystack with FAISS on Mac. So, I decided to document the solution here for others.

When trying to install pip install 'farm-haystack[docstores,faiss]' it failed with the following error

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

The solution was to run xcode-select --install and re-install haystack and it solved the problem.

Then when importing the haystack and running the program I got the following error -Error #15: Initializing libiomp5.dylib, but found libiomp5.dylib already initialized

To solve this, I needed to tell Conda to not use MKL conda install nomkl. But installing nomkl after installing farm-haystack doesn't solve the problem. I need to start with a new environment.

To summarize, here are the steps.

  1. xcode-select --install
  2. Create new conda environment
  3. conda install nomkl
  4. pip install 'farm-haystack[docstores,faiss]'
0

There are 0 best solutions below