简体   繁体   中英

Unable to import SMOTE due to error <<ImportError: cannot import name 'lobpcg' from 'sklearn.utils.fixes' >>

Unable to import SMOTE due to error ImportError: cannot import name 'lobpcg' from 'sklearn.utils.fixes' (E:\\Installations\\lib\\site-packages\\sklearn\\utils\\fixes.py)

Above error is displayed when I am trying to import below packages

from imblearn.combine          import SMOTETomek

from imblearn                  import under_sampling, over_sampling

from imblearn.over_sampling    import SMOTE

I have conda installed sklearn, imbllearn. Can some one help me to resolve this error

This is error is raised within scikit-learn.

Be sure to install both library using:

conda install scikit-learn -c conda-forge 
conda install imbalanced-learn -c conda-forge

Be aware that I am using the conda-forge channel to install scikit-learn to get the version 0.22 because the latest version is not available on the conda default channel for the moment.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM