sklearn cannot import name _ellipsoid

Viewed 9143

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.

3 Answers

This mostly happens when you have 2 versions of scipy one with pip and other with conda may be, just check the scipy lib its referring to or try and uninstall one if there are 2 scipy with different installers.

Also try and use the latest version of scipy

Related