catch networkx error (#1201)

searx-query-suffixy
Harrison Chase 1 year ago committed by GitHub
parent 44c8d8a9ac
commit fb83cd4ff4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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…
Cancel
Save