sunitprasad1
sunitprasad1

Reputation: 768

ImportError: cannot import name _distributor_init

While trying to import scipy, I'm getting the following error :

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-7-4dc45f4c0083> in <module>()
----> 1 import scipy

C:\Users\admin\Anaconda2\lib\site-packages\scipy\__init__.py in <module>()
     74 
     75 # Allow distributors to run custom init code
---> 76 from . import _distributor_init
     77 
     78 __all__ += _num.__all__

ImportError: cannot import name _distributor_init

I have tried re-installing from pip by force reinstall, it says that scipy is up-to-date but then, loading it gives the above error. How do I resolve it? I'm using Python 2.x version.

Upvotes: 3

Views: 10142

Answers (3)

just upgrade your sklearn, upgrade everything and u will be fine

Upvotes: -1

libaojie
libaojie

Reputation: 11

I use cx_Freeze and package have this error. I add this code to solve this problem:

self.build_exe_options = {
    'includes': "scipy._distributor_init"
}

Upvotes: 1

Xavier G
Xavier G

Reputation: 26

I was getting the same error while using cx_freeze, i managed to make it work by simply commenting this line in the init.py of scipy (---> 76 from . import _distributor_init). From what i read there: [Numpy-discussion] Hook in init.py to let distributors patch numpy it simply enables more customization of checks, that i didn't need. Scipy seems to work just fine without it. Fyi I installed scipy without using anaconda, and i use python 3.6. Hope this helps.

Upvotes: 1

Related Questions