private-gpt icon indicating copy to clipboard operation
private-gpt copied to clipboard

python3 ingest.py -> AttributeError: module 'hnswlib' has no attribute 'Index'

Open aalfaukyapo354 opened this issue 1 year ago • 2 comments

Creating new vectorstore Loading documents from source_documents Loading new documents: 100%|█████████████████████| 1/1 [00:00<00:00, 172.05it/s] Loaded 1 new documents from source_documents Split into 90 chunks of text (max. 500 tokens each) Creating embeddings. May take some minutes... Using embedded DuckDB with persistence: data will be stored in: db Traceback (most recent call last): File "/root/privateGPT/ingest.py", line 167, in main() File "/root/privateGPT/ingest.py", line 159, in main db = Chroma.from_documents(texts, embeddings, persist_directory=persist_directory, client_settings=CHROMA_SETTINGS) File "/root/privateGPT/myenv/venv/lib/python3.10/site-packages/langchain/vectorstores/chroma.py", line 413, in from_documents return cls.from_texts( File "/root/privateGPT/myenv/venv/lib/python3.10/site-packages/langchain/vectorstores/chroma.py", line 374, in from_texts chroma_collection = cls( File "/root/privateGPT/myenv/venv/lib/python3.10/site-packages/langchain/vectorstores/chroma.py", line 88, in init self._client = chromadb.Client(self._client_settings) File "/root/privateGPT/myenv/venv/lib/python3.10/site-packages/chromadb/init.py", line 91, in Client return chromadb.api.local.LocalAPI(settings, get_db(settings), telemetry_client) File "/root/privateGPT/myenv/venv/lib/python3.10/site-packages/chromadb/init.py", line 46, in get_db import chromadb.db.duckdb File "/root/privateGPT/myenv/venv/lib/python3.10/site-packages/chromadb/db/duckdb.py", line 2, in from chromadb.db.clickhouse import ( File "/root/privateGPT/myenv/venv/lib/python3.10/site-packages/chromadb/db/clickhouse.py", line 10, in from chromadb.db.index.hnswlib import Hnswlib, delete_all_indexes File "/root/privateGPT/myenv/venv/lib/python3.10/site-packages/chromadb/db/index/hnswlib.py", line 73, in class Hnswlib(Index): File "/root/privateGPT/myenv/venv/lib/python3.10/site-packages/chromadb/db/index/hnswlib.py", line 75, in Hnswlib _index: hnswlib.Index AttributeError: module 'hnswlib' has no attribute 'Index'

python3 --version == 3.10.6 hnswlib = 0.7.0 chromadb==0.3.23

aalfaukyapo354 avatar May 23 '23 08:05 aalfaukyapo354

can you please provide pip install hnswlib output?

cobanov avatar May 23 '23 09:05 cobanov

download and install the "Microsoft C++ Build Tools" from the official Visual Studio website. Here are the steps you can take:

Visit the following URL: https://visualstudio.microsoft.com/visual-cpp-build-tools/.

On the webpage, you should see a "Download" button for the Visual Studio Build Tools. Click on it to initiate the download.

Once the download is complete, run the installer and follow the instructions to install the Microsoft C++ Build Tools.

During the installation process, make sure to select the necessary components for C++ development. This typically includes selecting the "C++ build tools" and any required packages or libraries.

After the installation is complete, try installing the hnswlib package again using pip.

jackfood avatar May 24 '23 13:05 jackfood