mirror of
https://github.com/hwchase17/langchain.git
synced 2025-08-15 23:57:21 +00:00
catch networkx error (#1201)
This commit is contained in:
parent
44c8d8a9ac
commit
fb83cd4ff4
@ -50,7 +50,13 @@ class NetworkxEntityGraph:
|
||||
|
||||
def __init__(self) -> None:
|
||||
"""Create a new graph."""
|
||||
import networkx as nx
|
||||
try:
|
||||
import networkx as nx
|
||||
except ImportError:
|
||||
raise ValueError(
|
||||
"Could not import networkx python package. "
|
||||
"Please it install it with `pip install networkx`."
|
||||
)
|
||||
|
||||
self._graph = nx.DiGraph()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user