简体   繁体   English

Pycharm:无法导入lightfm

[英]Pycharm: cannot import lightfm

I tried to load the movie_lens dataset using the code below 我尝试使用下面的代码加载movie_lens数据集

from lightfm.datasets import fetch_movielens

running this i am getting: ImportError: No module named 'lightfm.datasets'; 'lightfm' is not a package 运行这个我得到: ImportError: No module named 'lightfm.datasets'; 'lightfm' is not a package ImportError: No module named 'lightfm.datasets'; 'lightfm' is not a package

It sounds like the lightfm package is not installed in your environment. 听起来好像你的环境中没有安装lightfm软件包。 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. 您可以在File>Project Structure>SDKs签入,确保在您用于项目的环境的“ 包”选项卡中存在lightfm Otherwise you can add the package from that same window. 否则,您可以从同一窗口添加包。

因为我已经尝试了很多方法并且失败了,最后我从默认的python3.5保存文件夹运行我的python终端 - >对我来说它是/ usr / bin,然后我在pycharm IDE中创建了一个新项目,使用pip3 istalled lightfm它也在那里工作,现在我可以导入LightFM

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM