Skip to content

Commit faec4ee

Browse files
fixes ladybug installation step
1 parent 6daffa6 commit faec4ee

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

src/codegraphcontext/core/__init__.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@ def _is_kuzudb_available() -> bool:
2626
except ImportError:
2727
return False
2828

29+
def _is_ladybugdb_available() -> bool:
30+
"""Check if LadybugDB is installed."""
31+
try:
32+
return importlib.util.find_spec("ladybug") is not None
33+
except ImportError:
34+
return False
35+
2936
def _is_falkordb_available() -> bool:
3037
"""Check if FalkorDB Lite is installed (Unix only)."""
3138
if platform.system() == "Windows":
@@ -127,8 +134,8 @@ def get_database_manager(db_path: Optional[str] = None) -> Union['DatabaseManage
127134
info_logger("Using Nornic DB (explicit)")
128135
return NornicDBManager()
129136
elif db_type == 'ladybugdb':
130-
if not _is_kuzudb_available():
131-
raise ValueError("Database set to 'ladybugdb' but LadybugDB core (kuzu) is not installed.\nRun 'pip install kuzu'")
137+
if not _is_ladybugdb_available():
138+
raise ValueError("Database set to 'ladybugdb' but LadybugDB is not installed.\nRun 'pip install ladybug'")
132139
from .database_ladybug import LadybugDBManager
133140
info_logger(f"Using LadybugDB (explicit) at {db_path or 'default path'}")
134141
return LadybugDBManager(db_path=db_path)

0 commit comments

Comments
 (0)