Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ImportError: cannot import name 'logsumexp' when importing sklearn.model_selection

I was trying to import sklearn.model_selection with Jupiter Notebook under anaconda environment with python 3.5, but I was warned that I didn't have "model_selection" module, so I did conda update scikit-learn.

After that, I received a message of ImportError: cannot import name 'logsumexp' when importing sklearn.model_selection.

I reinstalled sklearn and scipy, but still received the same error message. May I have some advice?

like image 547
J.Su Avatar asked Mar 27 '17 04:03

J.Su


2 Answers

I came across exactly the same problem just now. After I updated scikit-learn and tried to import sklearn.model_selection, the ImportError appeared.

I just restarted anaconda and ran it again.

It worked. Don't know why.

like image 172
Braidy916 Avatar answered Nov 14 '22 21:11

Braidy916


It's not the best solution, but rolling back to 0.18.2 worked for me (after trying all above-mentioned solutions):

pip uninstall scikit-learn
pip install scikit-learn==0.18.2

Ultimately, it worked with version 0.18.2 of scikit-learn and version 1.2.0 of scipy.

like image 36
orialz Avatar answered Nov 14 '22 22:11

orialz