Problem with imblearn package -- "ImportError: cannot import name 'six'"

Hello everyone,

I’m doing the Quizz1 in google colab, but It’s impossible to import imblearn. I uninstalled and reinstalled, but I’m still facing the same issue. Can anyone help me with this please ?

Thank you

ImportError Traceback (most recent call last)

in () ----> 1 from imblearn.over_sampling import SMOTE

1 frames

/usr/local/lib/python3.6/dist-packages/imblearn/ in () 13 14 from sklearn.base import BaseEstimator —> 15 from sklearn.externals import six 16 from sklearn.preprocessing import label_binarize 17 from sklearn.utils import check_X_y

ImportError: cannot import name ‘six’

--------------------------------------------------------------------------- NOTE: If your import is failing due to a missing package, you can manually install dependencies using either !pip or !apt. To view examples of installing some common dependencies, click the “Open Examples” button below. ---------------------------------------------------------------------------

I finally made it work. I think there was a problem with my notebook colab’s environment. I made a copy of the colab notebook so it is completely reinitialized, and it worked. (reinitializing the kernel did not :-/)


yeah, so basically the package is deprecated and it will only work on certain versions. Hence, the issue. Glad it worked for you.