Search code examples
pythonpycharmrecommendation-engine

Pycharm: cannot import lightfm


I tried to load the movie_lens dataset using the code below

from lightfm.datasets import fetch_movielens

running this i am getting: ImportError: No module named 'lightfm.datasets'; 'lightfm' is not a package


Solution

  • It sounds like the lightfm package is not installed in your environment. You can check in File>Project Structure>SDKs make sure lightfm is present in the Packages tab of the environment you're using for your project. Otherwise you can add the package from that same window.