recommenders-team / recommenders

Best Practices on Recommendation Systems
https://recommenders-team.github.io/recommenders/intro.html
MIT License
18.9k stars 3.08k forks source link

[ASK] cannot import name 'store_metadata' from 'recommenders.utils.notebook_utils' #2082

Closed echo0624 closed 5 months ago

echo0624 commented 6 months ago

I used Python version 3.9.7 in anaconda and installed recommendations using pip. However, I encountered the following error while running lightfm deep dive(the first in). Even after reinstalling, it still hasn't been resolved. What is the problem?

ImportError Traceback (most recent call last) Cell In[3], line 28 18 from recommenders.datasets import movielens 19 from recommenders.models.lightfm.lightfm_utils import ( 20 track_model_metrics, 21 prepare_test_df, (...) 26 similar_items, 27 ) ---> 28 from recommenders.utils.notebook_utils import store_metadata 30 print("System version: {}".format(sys.version)) 31 print("LightFM version: {}".format(lightfm.version))

ImportError: cannot import name 'store_metadata' from 'recommenders.utils.notebook_utils' (C:\Users\lenovo\anaconda3\envs\python3.9.7_recommenders\lib\site-packages\recommenders\utils\notebook_utils.py)

echo0624 commented 5 months ago

I reinstalled this project in the Linux system and resolved the issue.

AndreasKarasenko commented 5 months ago

I followed the installation steps from the repository and installed everything under WSL2 Ubuntu-22.04 but get that same error (also map cannot be imported) because the module is missing several functions. I use Python3.9.19 and installed recommenders[gpu] version 1.1.1.

Any idea why that is the case? Here are some of the errors I get running sar_movielens.ipynb cannot import name 'map' from 'recommenders.evaluation.python_evaluation' --> Fixed by changing map to map_at_k cannot import name 'store_metadata' from 'recommenders.utils.notebook_utils' --> Completely misses the function in the package.

hanifmasy commented 5 months ago
ImportError                               Traceback (most recent call last)
<ipython-input-1-d5e22dc427ad> in <module>
     10 import recommenders.datasets.criteo as criteo
     11 import recommenders.models.lightgbm.lightgbm_utils as lgb_utils
---> 12 from recommenders.utils.notebook_utils import store_metadata
     13 
     14 print("System version: {}".format(sys.version))
ImportError: cannot import name 'store_metadata'

reinstalled the project in the linux system did not resolve the issue. have the settings on the module changed?