Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sklearn cannot import name _ellipsoid

On my computer sklearn has been working like half a year ago, I have stopped using it and now it isn't. I'm having trouble with an import statement in my program.py :

from sklearn import tree

which looks really messy:

Traceback (most recent call last):   File "E:/DecisionModel.py", line 1, in <module>
    from sklearn import tree   File "C:\Users\AppData\Local\Programs\Python\Python35\lib\site-packages\sklearn\__init__.py", line 57, in <module>
    from .base import clone   File "C:\Users\AppData\Local\Programs\Python\Python35\lib\site-packages\sklearn\base.py", line 12, in <module>
    from .utils.fixes import signature   File "C:\Users\AppData\Local\Programs\Python\Python35\lib\site-packages\sklearn\utils\__init__.py", line 11, in <module>
    from .validation import (as_float_array,   File "C:\Users\AppData\Local\Programs\Python\Python35\lib\site-packages\sklearn\utils\validation.py", line 18, in <module>
    from ..utils.fixes import signature   File "C:\Users\AppData\Local\Programs\Python\Python35\lib\site-packages\sklearn\utils\fixes.py", line 403, in <module>
    from scipy.stats import rankdata   File "C:\Users\AppData\Local\Programs\Python\Python35\lib\site-packages\scipy\stats\__init__.py", line 344, in <module>
    from .stats import *   File "C:\Users\AppData\Local\Programs\Python\Python35\lib\site-packages\scipy\stats\stats.py", line 173, in <module>
    import scipy.special as special   File "C:\Users\AppData\Local\Programs\Python\Python35\lib\site-packages\scipy\special\__init__.py", line 643, in <module>
    from ._ellip_harm import ellip_harm, ellip_harm_2, ellip_normal   File "C:\Users\AppData\Local\Programs\Python\Python35\lib\site-packages\scipy\special\_ellip_harm.py", line 7, in <module>
    from ._ellip_harm_2 import _ellipsoid, _ellipsoid_norm ImportError: cannot import name '_ellipsoid'

Some useful info: While ago the error was that it cannot import NUMPY_MKL which I installed as a wheel from here.

like image 406
Yurkee Avatar asked May 24 '17 12:05

Yurkee


1 Answers

Did you try to reinstall scikit-learn? If you use pip, you can give the following commands a go:

python -m pip install --upgrade pip
python -m pip install --upgrade --force-reinstall scikit-learn
like image 70
Darius Avatar answered Sep 25 '22 17:09

Darius