繁体   English   中英

如何解决 tensorflow 的 JupyterNotebook 中未找到模块错误?

[英]How to resolve module not found error in JupyterNotebook for tensorflow?

我使用以下命令集创建了 tensorflow 环境:

conda create --name py3-TF2.0 python = 3

conda activate py3-TF2.0
conda install tensorflow
pip install -upgrade tensorflow
pip install ipykernel

在此处输入图像描述

尝试这些步骤以使用 Conda 安装 Tensorflow

#create virtual environmenttf2.0 using conda 
conda create --name tf2.0 python=3
#Activate the env
conda activate tf2.0
#Install Tensorflow
tf2.0$pip install tensorflow
tf2.0$python
#Verify the Tensorflow installation before launching any of the IDE
>>import tensorflow as tf
>>tf.__version__


#Launch the jupyter notebook
tf2.0$conda install jupyter
tf2.0$jupyter notebook

你可以做的是运行 jupyter notebook 并尝试从那里安装 tensorflow。

在 jupyter 笔记本单元格中输入:

!pip install tensorflow==2.0.0

(不要错过 ! 之前的标志)

去测试:

import tensorflow as tf
tf.__version__

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM