RUCAIBox / RecBole

A unified, comprehensive and efficient recommendation library
https://recbole.io/
MIT License
3.43k stars 614 forks source link

[🐛BUG] Mandatory and optional dependencies #2105

Open lorepirri opened 4 days ago

lorepirri commented 4 days ago

Describe the bug

Run pip install recbole and python run_recbole.py as specified in the README.me will throw:

  File "<redacted_folder>/recbole/model/general_recommender/ldiffrec.py", line 29, in <module>
    from kmeans_pytorch import kmeans
ModuleNotFoundError: No module named 'kmeans_pytorch'

The dependency kmeans-pytorch is not installed by pip because it's not listed in the setup.py: https://inspector.pypi.io/project/recbole/1.2.0/packages/6b/b1/43993a85af17148e495c7c26d05f76fc622a9eefd5db38ef9a6ea908422b/recbole-1.2.0.tar.gz/recbole-1.2.0/setup.py#line.9

I wonder if some of the dependencies listed in https://github.com/RUCAIBox/RecBole/blob/v1.2.0/.github/workflows/python-package.yml#L36-L51 should be moved into the requirements.txt updating setup.py as well.

To Reproduce Steps to reproduce the behavior:

  1. Run pip install recbole
  2. Run python run_recbole.py

Expected behavior A run without errors as described in README.md

Desktop (please complete the following information):

lorepirri commented 1 day ago

@BishopLiu thanks for taking care of this. How about torch-scatter and dgl? Some other tests require them. Are they optional dependencies or mandatory?

The tests that are failing are

tests/model/test_model_auto.py::TestKnowledgeRecommender::test_kgat
tests/model/test_model_auto.py::TestKnowledgeRecommender::test_kgat_with_gcn
tests/model/test_model_auto.py::TestKnowledgeRecommender::test_kgat_with_graphsage
tests/model/test_model_auto.py::TestKnowledgeRecommender::test_kgin
tests/model/test_model_auto.py::TestKnowledgeRecommender::test_mcclk
lorepirri commented 4 hours ago

@BishopLiu @Fotiligner any hint? I could create a PR to fix it, knowing which ones are mandatory dependencies or only optional.