如何在使用jupyter笔记本时修复windows中的“import tensorflow as tf”错误

问题描述 投票:0回答:3

大家好我试图导入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

以上是我尝试的代码和我得到的错误

tensorflow pip jupyter-notebook anaconda
3个回答
0
投票

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

!conda install numpy tensorflow

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


0
投票

你的numpy安装有点腐败或完全破坏。请重新安装numpy。


0
投票

这是一个numpy问题。跑:

conda install -c conda-forge numpy 
© www.soinside.com 2019 - 2024. All rights reserved.