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), I got an message regarding "ModuleNotFoundError". No module named 'imblearn".
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
How could I resolve this?
Open Anaconda Prompt and type in
I have faced the same problem and I installed
imblearn
first by typing this command:in jupyter notebook and then it is fine
This worked for me:
Then, I was able to import
SMOTE
package.Problems importing imblearn python package on ipython notebook
Found the answer here. This worked for me
I used in this code in my Jupyter Notebook and it works fine.
Just in case someone encounters this problem on Google Cloud Jupyter notebook instances, using pip3 to install imblearn made it work for me, after failing with pip command:
or directly in the notebook:
You should see imblearn (0.0) and imbalanced-learn (4.3) in your pip list.
NB! Make sure to reload your notebooks (File -> Close and Shutdown), otherwise it might fail to import the library after install.