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.
xcode-select --install
- Create new conda environment
conda install nomkl
pip install 'farm-haystack[docstores,faiss]'