Skip to content

Commit 79d4e47

Browse files
committed
Add warning
1 parent f808f95 commit 79d4e47

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

examples/customize/retrievers/external/qdrant/populate_dbs.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,24 @@
1818

1919
import hashlib
2020
import json
21-
import os
2221
from typing import Any, Literal
2322

2423
import neo4j
2524
from neo4j import GraphDatabase
2625
from neo4j_graphrag.indexes import create_vector_index, drop_index_if_exists
27-
from qdrant_client import QdrantClient, models
26+
27+
try:
28+
from qdrant_client import QdrantClient, models
29+
except ImportError as e:
30+
missing_module = str(e).split("'")[1]
31+
if missing_module == "qdrant_client":
32+
raise ImportError(
33+
"The 'qdrant-client' package is missing. Please install it by running "
34+
"`poetry install --extras \"qdrant\"` or `pip install qdrant-client`, or follow the instructions "
35+
"in the Qdrant examples section of the README at https://github.com/neo4j/neo4j-graphrag-python/"
36+
) from e
37+
else:
38+
raise
2839

2940
# biology
3041
EMBEDDING_BIOLOGY = [

0 commit comments

Comments
 (0)