Search code examples
pythonscikit-learnimblearn

Unable to import from imblearn.over_sampling import SMOTE


I have installed imblearn using

pip install -U imbalanced-learn
#version:
conda version : 4.4.10
conda-build version : 3.4.1
python version : 3.6.4.final.0

I keep getting error related to numpy and scipy like module 'numpy.random' has no attribute 'mtrand' module 'numpy.polynomial' has no attribute 'polynomial'

np.version Out[11]: '1.14.0'

scipy.version Out[17]: '1.2.1'

Please let me know how to fix this

Also, I am unable to import any sklearn package. I tried:

pip install --upgrade scikit-learn
pip install --upgrade sklearn

For these I get Requirement already up-to-date


Solution

  • Use this, instead:

    pip install imblearn
    

    There are two different packages, SMOTE, and SMOTEENN