Skip to content

Knowledge graph memory misses instructions on library to install #1161

@bent-verbiage

Description

@bent-verbiage

When trying to assign Knowledge graph memory to a chain while networkx is not installed yet, you'll get the error below. This is not in line with the rest of the langchain codebase, which will catch the error and tell you to

pip install networkx
The documentation on Knowledge graph memory also doesn't refer to networkx.

 File "pydantic/main.py", line 340, in pydantic.main.BaseModel.__init__ File "pydantic/main.py", line 1067, in pydantic.main.validate_model File "pydantic/fields.py", line 439, in pydantic.fields.ModelField.get_default File "/Users/<local>/envs/py310/lib/python3.10/site-packages/langchain/graphs/networkx_graph.py", line 53, in __init__ import networkx as nx ModuleNotFoundError: No module named 'networkx' 

Great to have this memory option!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions