Python – Pycharm: Unable to import lightfm

Pycharm: Unable to import lightfm… here is a solution to the problem.

Pycharm: Unable to import lightfm

I tried loading the movie_lens dataset using the code below

Import fetch_movielens from lightfm.datasets

Running this I get:
ImportError: There is no module named "lightfm.datasets"; "lightfm" is not a package

Solution

It sounds like you don’t have the Lightfm package installed in your environment. You can check File>Project Structure>SDKs to make sure that lightfm appears in the Packages tab of the environment you are using for your project. Otherwise, you can add packages from the same window.

Related Problems and Solutions