如何在使用Jupyter Notebook时在Windows中修复“将Tensorflow作为tf导入”错误

时间:2019-04-09 18:09:40

标签: tensorflow pip jupyter-notebook anaconda

大家好,我试图导入tensorflow但无法执行该操作。而另一方面可以将其安装在jupyter笔记本中。请帮忙 !

ModuleNotFoundError                       Traceback (most recent call last)
ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'


---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
ImportError: numpy.core.multiarray failed to import

The above exception was the direct cause of the following exception:

SystemError                               Traceback (most recent call last)
~\Anaconda3\lib\importlib\_bootstrap.py in _find_and_load(name, import_)

SystemError: <class '_frozen_importlib._ModuleLockManager'> returned a result with an error set


---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
ImportError: numpy.core._multiarray_umath failed to import


---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
ImportError: numpy.core.umath failed to import

上面是我尝试过的代码和我遇到的错误

3 个答案:

答案 0 :(得分:0)

您的numpy安装已损坏或完全损坏。请重新安装numpy。

答案 1 :(得分:0)

您正在使用Anaconda3。如果您已经通过pip安装了tensorflow,请将其删除,然后运行

!conda install numpy tensorflow

如果您有GPU,请改用tensorflow-gpu。

答案 2 :(得分:0)

这是一个numpy问题。运行:

conda install -c conda-forge numpy