繁体   English   中英

如何解决 ModuleNotFoundError: No module named 'tensorflow' 问题?

[英]How can I resolve ModuleNotFoundError: No module named 'tensorflow' problem?

Tensorflow 已成功安装在我的笔记本电脑上。

Name: tensorflow
Version: 2.2.0
Summary: TensorFlow is an open source machine learning framework for everyone.
Home-page: https://www.tensorflow.org/
Author: Google Inc.
Author-email: packages@tensorflow.org
License: Apache 2.0
Location: c:\users\my name\anaconda3\lib\site-packages
Requires: protobuf, astunparse, h5py, opt-einsum, wrapt, grpcio, termcolor, gast, tensorflow-estimator, scipy, six, tensorboard, wheel, google-pasta, numpy, keras-preprocessing, absl-py
Required-by:

环境为 Windows 8.1、python 3.7.1、pip 20.1.1。

当我运行这个测试文件

import tensorflow as tf
hello = tf.constant("hello TensorFlow!")
sess=tf.Session()
print(sess.run(hello))

,我收到以下错误消息:

ModuleNotFoundError: No module named 'tensorflow'.

我该如何解决这个问题?

只需使用 pip 安装即可:

pip install tensorflow

检查此页面: https://pypi.org/project/tensorflow/

暂无
暂无

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

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