无法在Jupyter Notebook中导入Numpy

时间:2020-08-21 02:43:44

标签: jupyter-notebook jupyter

我在jupyter笔记本中运行某些型号,但是我的电脑突然崩溃了。重新启动计算机后,我无法在jupyter笔记本中导入numpy,并出现以下错误:

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
~\miniconda3\envs\fraud_detection\lib\site-packages\numpy\core\__init__.py in <module>
     21 try:
---> 22     from . import multiarray
     23 except ImportError as exc:

~\miniconda3\envs\fraud_detection\lib\site-packages\numpy\core\multiarray.py in <module>
     11 
---> 12 from . import overrides
     13 from . import _multiarray_umath

~\miniconda3\envs\fraud_detection\lib\site-packages\numpy\core\overrides.py in <module>
      6 
----> 7 from numpy.core._multiarray_umath import (
      8     add_docstring, implement_array_function, _get_implementing_args)

ImportError: DLL load failed while importing _multiarray_umath: The specified module could not be found.

During handling of the above exception, another exception occurred:

ImportError                               Traceback (most recent call last)
<ipython-input-1-d4cdadb62aa7> in <module>
----> 1 import numpy

~\miniconda3\envs\fraud_detection\lib\site-packages\numpy\__init__.py in <module>
    138     from . import _distributor_init
    139 
--> 140     from . import core
    141     from .core import *
    142     from . import compat

~\miniconda3\envs\fraud_detection\lib\site-packages\numpy\core\__init__.py in <module>
     46 """ % (sys.version_info[0], sys.version_info[1], sys.executable,
     47         __version__, exc)
---> 48     raise ImportError(msg)
     49 finally:
     50     for envkey in env_added:

ImportError: 

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.

We have compiled some common reasons and troubleshooting tips at:

    https://numpy.org/devdocs/user/troubleshooting-importerror.html

Please note and check the following:

  * The Python version is: Python3.8 from "C:\Users\miniconda3\envs\fraud_detection\python.exe"
  * The NumPy version is: "1.19.1"

and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.

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

我尝试删除整个anaconda和jupyter笔记本,但仍然无法正常工作。奇怪的是,当我在conda命令shell中启动python时,我可以成功导入numpy。非常感谢您的帮助!

0 个答案:

没有答案