【问题标题】:Tensorflow in windows using python pip使用python pip在Windows中的Tensorflow
【发布时间】:2017-05-18 18:52:11
【问题描述】:

使用 pip 命令安装了 python 3.5.2 和 tensorflow,但在导入 tensorflow 包时出错。 使用命令 as import tensorflow as tf 来导入 tensorflow。但出现错误;

Traceback(最近一次调用最后一次):

文件“”,第 1 行,在

ImportError: 没有名为“tensorflow”的模块

我该如何纠正这个错误? 我能尽快得到答案吗..

【问题讨论】:

  • 你能做一个pip freeze 并在这里显示输出吗?
  • appdirs==1.4.3 numpy==1.12.1 packaging==16.8 protobuf==3.3.0 pyparsing==2.2.0 6==1.10.0 tensorflow==1.1.0 Werkzeug= =0.12.2 您正在使用 pip 版本 8.1.1,但版本 9.0.1 可用。您应该考虑通过“python -m pip install --upgrade pip”命令进行升级。

标签: python windows tensorflow


【解决方案1】:

您是在 IDE 还是 ipython 或 Jupyter 上运行? 如果是,则 IDE 很可能正在使用不同的 python,例如 virtualenv。您的系统中可能安装了多个 python。

打开 cmd 并尝试以下操作

$ where python
$ python -c "import tensorflow"

确保得到的路径与安装路径一致。

如果还是有错误,对比这个路径

$ where pip

如果有多个 python,您的系统可能正在使用不同的 python 路径。

【讨论】:

  • 我正在使用 powershell 。我删除了安装 python 的不同路径。仍然遇到同样的问题。
猜你喜欢
  • 2017-09-05
  • 2023-04-09
  • 2017-04-21
  • 2021-10-27
  • 2013-06-16
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-01-21
相关资源
最近更新 更多