python-3.xanacondaimblearn

Jupyter: No module named 'imblearn" after installation


I installed "imbalanced-learn" (version 0.3.1) on ANACONDA Navigator. When I ran an example from the imbalanced-learn website using Jupyter (Python 3):

from imblearn.datasets import make_imbalance
from imblearn.under_sampling import NearMiss
from imblearn.pipeline import make_pipeline
from imblearn.metrics import classification_report_imbalanced

I got an message regarding "ModuleNotFoundError".

ModuleNotFoundError: No module named 'imblearn'

How could I resolve this?


Solution

  • Problems importing imblearn python package on ipython notebook

    according to the answer in the above link:

        conda install -c glemaitre imbalanced-learn
    

    A more official one is this:

    conda install -c conda-forge imbalanced-learn