Mac Monterey系统下farm-haystack搭配FAISS安装问题及解决方案
Mac Monterey下安装farm-haystack搭配FAISS的解决方案
问题1:安装命令执行失败
执行安装命令 pip install 'farm-haystack[docstores,faiss]' 时出现以下错误:
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
解决方法:执行命令 xcode-select --install 安装Command Line Tools,之后重新执行安装命令即可。
问题2:导入haystack时初始化错误
运行程序导入haystack时出现错误:
Error #15: Initializing libiomp5.dylib, but found libiomp5.dylib already initialized
解决方法:创建新的conda环境,先执行 conda install nomkl 禁用MKL库,再安装farm-haystack即可解决库冲突问题。
完整操作步骤
- 执行命令安装Command Line Tools:
xcode-select --install - 创建新的conda环境(示例:
conda create -n haystack_env python=3.9) - 激活环境后执行:
conda install nomkl - 最后安装farm-haystack:
pip install 'farm-haystack[docstores,faiss]'
内容的提问来源于stack exchange,提问作者eboraks
相关产品推荐
相关产品推荐

