0

I coded in jupyter-notebook, fetching data from mysqlserver and then downloaded it as a python script because I want to implement it in my website using cronjob. So when I run the Python script, I'm getting this error:

import seaborn as sns
  File "C:\Users\Debadri\AppData\Local\Programs\Python\Python36\lib\site-packages\seaborn\__init__.py", line 6, in <module>
    from .rcmod import *
  File "C:\Users\Debadri\AppData\Local\Programs\Python\Python36\lib\site-packages\seaborn\rcmod.py", line 5, in <module>
    from . import palettes, _orig_rc_params
  File "C:\Users\Debadri\AppData\Local\Programs\Python\Python36\lib\site-packages\seaborn\palettes.py", line 12, in <module>
    from .utils import desaturate, set_hls_values, get_color_cycle
  File "C:\Users\Debadri\AppData\Local\Programs\Python\Python36\lib\site-packages\seaborn\utils.py", line 7, in <module>
    from scipy import stats
  File "C:\Users\Debadri\AppData\Local\Programs\Python\Python36\lib\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'

I tried to install numpy+mkl .whl file from this link: Numpy+MKL, this (numpy‑1.15.1+mkl‑cp37‑cp37m‑win_amd64.whl) package, but it showed, not supported when I tried to install it.

Debadri Dutta
  • 1,183
  • 1
  • 13
  • 39

1 Answers1

0

The following solution worked out:

Solution: If you are using windows make sure you install numpy+mkl instead of just numpy. If you have already installed scipy and numpy, uninstall then using "pip uninstall scipy" and "pip uninstall numpy"

Now download scipy from http://www.lfd.uci.edu/~gohlke/pythonlibs/#scipy (appropriate version for your python and system) and install using "pip install scipy‑1.1.0‑cp36‑cp36m‑win_amd64.whl" (Please install from the list according to your system config)

Your numpy and Scipy both should work now. These binaries by Christoph Gohlke makes it very easy to install python packages on windows. But make sure you download all the dependent packages from there.

Reference: 4th answer of this question ImportError: cannot import name NUMPY_MKL

Debadri Dutta
  • 1,183
  • 1
  • 13
  • 39