Python 找不到 Tensorflow 模块



在Python3.5中,我尝试使用"tensorflow"模块:

import tensorflow as tf

但是......它说No mudule named tensorflow

我只是尝试使用 pip3 下载模块:

pip3 install --upgrade tensorflow-gpu

(我有使用 GPU 支持运行 tensorflow 的所有要求,如 tensorflow.org 中所述(

我在这里看到了类似的问题 导入错误:没有名为张量流的模块,以下是内部内容的总结:

  1. 通过以下方式确保安装正确:pip3 show tensorflow
  2. 您可以选择使用以下方法重新安装它:pip install tensorflow==1.2.0 --ignore-installed
  3. 确保使用 Python 3.x 运行 python 代码,请使用以下命令进行验证:python --version
  4. 确保安装TF并通过同一用户运行脚本,避免使用sudo pip install...安装TF并使用python script.py运行代码

相关内容

最新更新