ModuleNotFoundError: No module named 'dask_xgboost'

Question:

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

Asked By: sogu

||

Answers:

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
Answered By: sogu

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

Answered By: amin
Categories: questions Tags: , , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.