Python Can';我不能在Jupyter中运行Tensorflow,但我可以在Mac终端中看到

Python Can';我不能在Jupyter中运行Tensorflow,但我可以在Mac终端中看到,python,tensorflow,keras,jupyter-lab,Python,Tensorflow,Keras,Jupyter Lab,在应用方向上,我可以看到tf安装在使用终端上 $ pip list | grep tensorflow tensorflow 2.3.1 tensorflow-estimator 2.3.0 但当我用Jupyter导入它时 import tensorflow as tf 它回来了 ModuleNotFoundError Traceback (most recent call

在应用方向上,我可以看到tf安装在使用终端上

$ pip list | grep tensorflow
tensorflow                         2.3.1
tensorflow-estimator               2.3.0
但当我用Jupyter导入它时

import tensorflow as tf
它回来了

ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-7-64156d691fe5> in <module>
----> 1 import tensorflow as tf

ModuleNotFoundError: No module named 'tensorflow'
ModuleNotFoundError回溯(最近一次调用)
在里面
---->1导入tensorflow作为tf
ModuleNotFoundError:没有名为“tensorflow”的模块
少了什么?
我还尝试创建单独的环境,但没有成功。

在终端上运行的
python
不一定与在jupyter上运行的相同。理想情况下,您应该创建一个虚拟环境,并在该环境上安装所需的所有软件包。然后,您可以使用
conda activate
激活此特定环境并在其上打开jupyter。这保证了所需的所有包都将始终存在,并且您将始终使用“正确”的python解释器。