Jupyter: No module named 'imblearn" after installation

Problems importing imblearn python package on ipython notebook

Found the answer here. This worked for me

conda install -c glemaitre imbalanced-learn

This worked for me:

!pip install imblearn

Then, I was able to import SMOTE package.

from imblearn.over_sampling import SMOTE

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:

pip3 install imblearn

or directly in the notebook:

!pip3 install imblearn

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.


imbalanced-learn is currently available on the PyPi’s reporitories and you can install it via pip:

pip install -U imbalanced-learn

The package is release also in Anaconda Cloud platform:

conda install -c conda-forge imbalanced-learn

enter image description here

enter image description here