简体   繁体   中英

ModuleNotFoundError: No module named 'dask_xgboost'

I am trying to run dask_ml functions but the system does not accept my installation and gives and error when I import it. OS: Linux ubuntu 20.

Installation to conda environment

conda install -c conda-forge dask-ml

Import

#dask
from dask_ml.xgboost import XGBClassifier

ERROR

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-148-885097890294> in <module>
      1 #dask
----> 2 from dask_ml.xgboost import XGBClassifier

~/anaconda3/lib/python3.8/site-packages/dask_ml/xgboost.py in <module>
      5 ``dask.distributed`` cluster.
      6 """
----> 7 from dask_xgboost import *  # noqa

ModuleNotFoundError: No module named 'dask_xgboost'

Possible Solutions

If you have only installed some parts of dask you may also need to install xgboost separately to anaconda

conda install -c conda-forge dask-xgboost

Actually, it seems you need to install other parts like dask-xgboost later. Even if you have already installed dask["complete"] and dask-ml .

Besides conda you can do it by ```pip`` also.

pip install dask-xgboost

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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