Skip to content

missing modules and problem with notebook paths #5

@ander-yamamoto

Description

@ander-yamamoto

Hi, I followed the notebook example. I got some problems along the way but I was able to solve them, at least for my environment.

These modules are missing from setup:

  • langchain-community
  • llama-index-embeddings-huggingface

Also, to solve issue 4 the module

  • community
    should be removed from setup.

Steps to replicate the problem and what I did to solve:
I tryed both on windows 10 and ubuntu 22.04

I installed Anaconda3-2024.06, created a new env and installed GraphReasoning.
It installed python 3.12.5

conda create -n GraphReasoning python pip jupyter
conda activate GraphReasoning
pip install git+https://github.com/lamm-mit/GraphReasoning

then I open python and try to import GraphReasoning but I get the error:

  • ModuleNotFoundError: Module langchain_community.document_loaders not found. Please install langchain-community to access this module. You can install it using pip install -U langchain-community``

Then I install the missing module

  • pip install -U langchain-community

and I open python and try to import GraphReasoning again which throws the error:

  • ModuleNotFoundError: No module named 'llama_index.embeddings.huggingface'

After pip install llama-index-embeddings-huggingface , the code import GraphReasoning works on python.

Then I open jupyter notebook example GraphReasoning - Graph Analysis.ipynb
On section "Load graph and embeddings" there is an error:

  • HTTPError: 404 Client Error: Not Found for url: https://huggingface.co/lamm-mit/GraphReasoning/resolve/main/GRAPHDATA//BioGraph.graphml

Note the double slash between GRAPHDATA and BioGraph.graphml!
I solved this by replacing every:
f"{data_dir}/{graph_name}" by f"{data_dir}{graph_name}"
f"{data_dir}/{embedding_file}" by f"{data_dir}{embedding_file}"

On Section "Graph statitcs an properties, I get the first graph ok, but the code
describe_communities_with_plots_complex(G, N=6, data_dir=data_dir_output)
give the error from issue 4

  • AttributeError: module 'community' has no attribute 'best_partition'

It seems the community module on setup generate a conflict with python-louvain module that is also installed as community:
references:
python-louvain module
Stack overflow
I solved by keeping python-louvain and removing community in setup.py

After these changes, the notebook Graph Analysis.ipynb runs without errors and all graphs are shown.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions