Jupyter Notebook: Importing SMOTE from imblearn - ImportError: cannot import name 'pairwise_distances_chunked'

13,052

Solution 1

I have encountered a similar problem. I could solve by opening a new IPython console.

Solution 2

I know it's a bit late, but for anyone using Jupyter notebook, I could solve my problem by just restarting the kernel.

Link:

ImportError: cannot import name check_array from sklearn.utils.validation

Share:
13,052
Billy Hansen
Author by

Billy Hansen

Updated on June 09, 2022

Comments

  • Billy Hansen
    Billy Hansen almost 2 years

    I'm trying to use the SMOTE package in the imblearn library using:

    from imblearn.over_sampling import SMOTE
    

    getting the following error message:

    ImportError: cannot import name 'pairwise_distances_chunked'.

    Here is a screenshot of my import screenshot of download confirmation

    Really stumped on this, any guidance would be greatly appreciated.

  • Billy Hansen
    Billy Hansen over 5 years
    It finally worked for me too once I closed and re-opened Jupyter notebook. A bit of an odd dynamic but I guess that's the fix.