无法使用Anaconda3 Distrobution导入Numpy

时间:2019-02-16 20:10:43

标签: python windows numpy anaconda

当我编写脚本导入numpy时,例如

import numpy as np

并尝试从Windows命令提示符(或双击脚本)运行与Anaconda3 2018.12(3.7.1)一起发行的Python版本,我收到以下错误:

Traceback (most recent call last):
  File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\core\__init__.py", line
 16, in <module>
    from . import multiarray
ImportError: DLL load failed: The specified module could not be found.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "recipe.py", line 1, in <module>
    import numpy as np
  File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\__init__.py", line 142,
 in <module>
    from . import add_newdocs
  File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\add_newdocs.py", line 1
3, in <module>
    from numpy.lib import add_newdoc
  File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\lib\__init__.py", line
8, in <module>
    from .type_check import *
  File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\lib\type_check.py", lin
e 11, in <module>
    import numpy.core.numeric as _nx
  File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\core\__init__.py", line
 26, in <module>
    raise ImportError(msg)
ImportError:
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.

我已经进行了一些研究,表明这是为Python 3.6.0安装Anaconda3的问题,但我现在所运行的版本没有任何信息。有没有人遇到过类似的问题并知道解决方法?

1 个答案:

答案 0 :(得分:0)

问题出在我设定道路的方式上。我不确定自己做错了什么,但是在安装过程中选择“将Anaconda添加到我的Path环境变量中”可以解决此问题。