Scikit install asks for Scipy even though it is installed


I am trying to install Scikit by running:

pip install scikit-learn

When I run it, I get this message:

Collecting scikit-learn
  Using cached scikit-learn-0.18.1.tar.gz
Installing collected packages: scikit-learn
  Running install for scikit-learn ... error
    Complete output from command c:python36python.exe -u -c "import setuptools, tokenize;__file__='C:\Users\USER\AppData\Local\Temp\pip-build-3080ikpy\scikit-learn\';f=getatt
r(tokenize, 'open', open)(__file__);'rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:UsersUSERAppDataLocalTemppip-04zx4iu6-recordi
nstall-record.txt --single-version-externally-managed --compile:
    Partial import of sklearn during the build process.
    Traceback (most recent call last):
      File "", line 149, in get_scipy_status
        import scipy
      File "", line 61, in <module>
        from numpy._distributor_init import NUMPY_MKL  # requires numpy+mkl
    ImportError: cannot import name 'NUMPY_MKL'
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "", line 270, in <module>
      File "", line 260, in setup_package
        .format(scipy_req_str, instructions))
    ImportError: Scientific Python (SciPy) is not installed.
    scikit-learn requires SciPy >= 0.9.
    Installation instructions are available on the scikit-learn website:

Which seems to ask me to install Scipy, however I already have Scipy installed, and indeed if I run

pip install scipy

I get

Requirement already satisfied: scipy in c:python36libsite-packages
Requirement already satisfied: numpy>=1.8.2 in c:python36libsite-packages (from scipy)
Asked By: Nadni



Your install shows this: from numpy._distributor_init import NUMPY_MKL # requires numpy+mkl ImportError: cannot import name 'NUMPY_MKL'

So you need to do a few things. Get the right SciPy:

Get the right NumPy:

Get the right SciKit Learn:

Now do pip uninstall each of your other packages. Then do pip install the wheels you downloaded at those links provided – NumPy 1st, SciPy 2nd, then Ski-kitlearn last. That should then solve your issue. Note at those links you’re downloading the files with cp36‑cp36m‑win32.whlor cp36‑cp36m‑win_amd64.whl depending on if you have 32bit or 64bit Python installed.

Answered By: Matt
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.