You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Trying to run the following code...
import { FaissStore } from "langchain/vectorstores/faiss";
import { OpenAIEmbeddings } from "langchain/embeddings/openai";
const vectorStore = await FaissStore.loadFromPython('./data/saved_index/', new OpenAIEmbeddings());
const results = await vectorStore.similaritySearch(query, 5);
Fails with the following Error on macOS 10.15.7
Uncaught (in promise) TRPCClientError: Could not import faiss-node. Please install faiss-node as a dependency with, e.g. `npm install -S faiss-node` and make sure you have `libomp` installed in your path.
Error: dlopen(/Users/michael/Workspace/potteryhelper.com/node_modules/faiss-node/build/Release/faiss-node.node, 1): Symbol not found: __ZNKSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEE3strEv
Referenced from: /Users/michael/Workspace/potteryhelper.com/node_modules/faiss-node/build/Release/faiss-node.node (which was built for Mac OS X 12.6)
Expected in: /usr/lib/libc++.1.dylib
at TRPCClientError.from (transformResult-6fb67924.mjs?v=5f4c615b:4:20)
at httpBatchLink.mjs?v=5f4c615b:190:56
from @ transformResult-6fb67924.mjs?v=5f4c615b:4
(anonymous) @ httpBatchLink.mjs?v=5f4c615b:190
Promise.catch (async)
callWithAsyncErrorHandling @ runtime-core.esm-bundler.js:168
invoker @ runtime-dom.esm-bundler.js:345
and this error on Netlify...
May 29, 12:37:31 AM: 36d0dca3 INFO Could not import faiss-node. Please install faiss-node as a dependency with, e.g. `npm install -S faiss-node` and make sure you have `libomp` installed in your path.
Error: libgomp.so.1: cannot open shared object file: No such file or directory
Environment:
Operating system: macOS 10.15.7
Nodejs Version: v18.12.1
Package Version: [e.g. v0.2.0]
To Reproduce
Steps to reproduce the behavior:
npm install faiss-node and "langchain": "^0.0.84"
run the above code
Expected behavior
index is rebuilt from python files and returns data
Screenshots
Additional context
I was able to get my local environment running by
git checkout faiss-node & npm install
Upgrade my CMake
npm run build
npm link
then back in my project... npm link faiss-node... effectively swapping out the locally built module for my project and it's dependencies
So I guess it's just an issue with compiling the library for older versions of macOS?
JavascriptMick
changed the title
dlopen Symbol not found error on macOS 10.15.7
dlopen Symbol not found error on macOS 10.15.7 and Netlify
May 29, 2023
So I guess it's just an issue with compiling the library for older versions of macOS?
I think this is the reason. The pre-build binary was compiled on macOS 12.6, some symbols on new version may not exist on the old version. Compiling it yourself may be a good option for now. I will add documentation later on how to compile.
For error on Netlify
Please try to install the missing package to see if it helps sudo apt-get install libgomp1 or yum install libgomp
I will further study whether there is a better solution on this issue.
Describe the bug
Trying to run the following code...
Fails with the following Error on macOS 10.15.7
and this error on Netlify...
Environment:
To Reproduce
Steps to reproduce the behavior:
Expected behavior
index is rebuilt from python files and returns data
Screenshots
Additional context
I was able to get my local environment running by
So I guess it's just an issue with compiling the library for older versions of macOS?
Here are my package.json dependencies
and faiss-node in my package-lock.json...
The text was updated successfully, but these errors were encountered: