0

我已经使用命令提示符成功安装了 CatBoost 和 LightGbM 模块。它给了我消息 Successly installed catboost-0.2.5(我之前也尝试过另一个)。但是,当我尝试将它们都导入到 jupyter 笔记本中时,我遇到了相同的错误:

import lightgbm as lgb

我得到:

ModuleNotFoundError: No module named 'lightgbm'

我也遇到了与 CatBoost 相同的错误。

有任何想法吗?谢谢!

4

1 回答 1

1

As discussed in the chat, it turns out that the environment where your Jupyter notebooks run and the one where you have installed the packages are different.

Since pip reports both packages installed in your "main" environment (i.e. the one coming up when you simply open a Windows command prompt), what you should do is open Jupyter from the command prompt, as

jupyter notebook

and your packages will indeed be available for importing, as we confirmed indeed.

于 2018-06-29T14:04:39.527 回答