First time here? Check out the FAQ!

Revision history  [back]

Anaconda cannot import modules such as numpy

This is a common problem we've been seeing so I'm adding it here as a question. Anaconda may fail to import modules like numpy with errors such as this:

import numpy
Traceback (most recent call last):
  Python Shell, prompt 1, line 1
    # Used internally for debug sandbox under external interpreter
  File "c:\Users\ylem\AppData\Local\Continuum\anaconda3\Lib\site-packages\numpy\", line 142, in <module>
    from . import add_newdocs
  File "c:\Users\ylem\AppData\Local\Continuum\anaconda3\Lib\site-packages\numpy\", line 13, in <module>
    from numpy.lib import add_newdoc
  File "c:\Users\ylem\AppData\Local\Continuum\anaconda3\Lib\site-packages\numpy\lib\", line 8, in <module>
    from .type_check import *
  File "c:\Users\ylem\AppData\Local\Continuum\anaconda3\Lib\site-packages\numpy\lib\", line 11, in <module>
import numpy.core.numeric as _nx
File "c:\Users\ylem\AppData\Local\Continuum\anaconda3\Lib\site-packages\numpy\core\", line 29, in <module>
  raise ImportError(msg)
Importing the multiarray numpy extension module failed.  Most
likely you are trying to import a failed build of numpy.
If you're working with a numpy git repo, try `git clean -xdf` (removes all
files not under version control).  Otherwise reinstall numpy.

Original error was: DLL load failed: The specified module could not be found.