1

I used python xy recently with an old lib of scipy (0.15). Because I wanted to use Spherical Voronoi, I had to install a more recent version of scipy. For this I used pip and the unofficial distributions for python modules with wheel. The install worked without error messages. But now, if I try to import scipy by code, I get this error message below. I already unistalled whole python packages so far and instead installed anaconda. But the error message is still the same. I checked my registry (Windows 10) - can't find anything suspicious.

Any idea? Thank you!

test.py
1.12.1
Traceback (most recent call last):
  File "test.py", line 11, in <module>
    import scipy
  File "C:\Users\Boss\AppData\Roaming\Python\Python27\site-packages\scipy\__init__.py", line 61, in <module>
    from numpy._distributor_init import NUMPY_MKL  # requires numpy+mkl
ImportError: cannot import name NUMPY_MKL
peterh
  • 11,875
  • 18
  • 85
  • 108
Shin Tzaii
  • 11
  • 1
  • 2
  • Possible duplicate of [ImportError: cannot import name NUMPY\_MKL](https://stackoverflow.com/questions/37267399/importerror-cannot-import-name-numpy-mkl) – Vikas Meena Jun 04 '17 at 18:36

2 Answers2

0

Updated - Your error is basically that  numpy+mkl (numpy with Intel math Kernel library) so this is because when you have installed the scipy by precompiled archive, which requires  numpy+mkl but installing numpy using pip won't get you that.

This problem can be easy solved by installation for numpy+mkl from whl file from - http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy

Old - This is due to the improper installation of numpy, I've had this error few days ago and then I had to install the numpy again. So, upgrade pip and then try installing the numpy whl again. It just worked for me.

Get it here -https://pypi.python.org/pypi/numpy

even this has almost everything - http://www.lfd.uci.edu/~gohlke/pythonlibs/

Vikas Meena
  • 322
  • 3
  • 20
  • I installed the current version of numpy succesfully with pip and the wheel. But unfortunately have the same problem. : see here (C:\Users\Boss\Anaconda2) C:\Users\Boss\Documents\Arbeit\Skripte>python -m test.py 1.13.0rc2 C:\Users\Boss\Anaconda2\python.exe: cannot import name NUMPY_MKL – Shin Tzaii Jun 03 '17 at 23:59
  • And pip is upgraded. Do you have any other idea? Thank you very much :-) – Shin Tzaii Jun 04 '17 at 00:01
  • Okay, then try my updated answer. This will solve your error. – Vikas Meena Jun 04 '17 at 04:12
  • It worked, sorry for answering so late ;-). My error was caused by an unrecognized double install of scipy - by cleaning everything it worked without problems – Shin Tzaii Jun 20 '17 at 19:42
  • @ShinTzaii how did you clean everything? – Chaine Jun 25 '17 at 02:50
0

Your scipy is built with mkl support and requires mkl support in numpy too. Download numpy from the same site you downloaded scipy (probably Christoph Gohlke's builds). Or if you are using Anaconda use Anaconda packages for both.

Stop harming Monica
  • 12,141
  • 1
  • 36
  • 56