2

I have the same problem as ImportError: DLL load failed: The specified module could not be found (sklearn) but I'm USING Anaconda. The error I get is at bottom. Is there a way to do this uninstall/reinstall separately without breaking my Anaconda install?

I've tried uninstalling and reinstalling scikit-learn. I was about to start uninstalling and reinstalling mkl and numpy but doing so would uninstall a whole host of other packages as well, at which point I'd likely be better off just reinstalling Anaconda from scratch. Except no guarantee I won't end up back at this same problem again if I do so.

Of note, I have a second computer with an Anaconda install that works fine so it must be a problem specific to my installation but I haven't managed to fix it.

 File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 710, in runfile
    execfile(filename, namespace)

  File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 101, in execfile
    exec(compile(f.read(), filename, 'exec'), namespace)

  File "C:/Users/shaff/Desktop/TUM Sync Folder/Machine Learning/1-decisiontrees and kNN/HW1.py", line 4, in <module>
    from sklearn import model_selection

  File "C:\ProgramData\Anaconda3\lib\site-packages\sklearn\__init__.py", line 134, in <module>
    from .base import clone

  File "C:\ProgramData\Anaconda3\lib\site-packages\sklearn\base.py", line 13, in <module>
    from .utils.fixes import signature

  File "C:\ProgramData\Anaconda3\lib\site-packages\sklearn\utils\__init__.py", line 11, in <module>
    from .validation import (as_float_array,

  File "C:\ProgramData\Anaconda3\lib\site-packages\sklearn\utils\validation.py", line 18, in <module>
    from ..utils.fixes import signature

  File "C:\ProgramData\Anaconda3\lib\site-packages\sklearn\utils\fixes.py", line 144, in <module>
    from scipy.sparse.linalg import lsqr as sparse_lsqr  # noqa

  File "C:\ProgramData\Anaconda3\lib\site-packages\scipy\sparse\linalg\__init__.py", line 113, in <module>
    from .isolve import *

  File "C:\ProgramData\Anaconda3\lib\site-packages\scipy\sparse\linalg\isolve\__init__.py", line 6, in <module>
    from .iterative import *

  File "C:\ProgramData\Anaconda3\lib\site-packages\scipy\sparse\linalg\isolve\iterative.py", line 7, in <module>
    from . import _iterative

ImportError: DLL load failed: The specified module could not be found.
T. Shaffner
  • 359
  • 1
  • 5
  • 22

1 Answers1

0

I tried the answer from this and got a success.

  1. First uninstall Numpy, Scipy, and Sklearn.
  2. Choose your Numpy+MKL installer from here and put it into the Anaconda Scripts folder.
  3. Reinstall Numpy with MKL using the installer you just downloaded.

    pip install --upgrade --force-reinstall "numpy-1.10.2+mkl-cp35-none-win32.whl"

  4. After that, reinstall Scipy and Sklearn.