xgboost安装Visual Studio代码

问题描述 投票:0回答:1

我使用以下代码在Visual Studio Code的终端中安装xgboost:

py -3 -m venv .venv
.venv\scripts\activate

python -m pip install xgboost

我收到此输出:

> Requirement already satisfied: xgboost in
> c:\users\xxx\.venv\lib\site-packages (0.90) Requirement already
> satisfied: numpy in c:\users\xxx\.venv\lib\site-packages (from
> xgboost) (1.17.3) Requirement already satisfied: scipy in
> c:\users\xxx\.venv\lib\site-packages (from xgboost) (1.3.1)

但是当我想在JupyterNotbook和import xgboost as xgb中使用xgboost时,出现此错误:

ModuleNotFoundError:没有名为“ xgboost”的模块

我正在Windows中使用Visual Studio Code。

python installation xgboost
1个回答
0
投票

感谢@ycx此问题将通过以下命令解决:

© www.soinside.com 2019 - 2024. All rights reserved.