【问题标题】:Importing issue with tensorflow in Python 3.5.3在 Python 3.5.3 中导入 tensorflow 问题
【发布时间】:2018-04-02 11:57:33
【问题描述】:

当我在 Python 3.5.3 中导入 tensorflow 时,它给了我以下信息:

错误:

没有名为 _pywrap_tensorflow

的模块

除非你使用 bazel,否则你 不应尝试从其源目录导入 tensorflow;请 退出 tensorflow 源代码树,然后重新启动你的 python 解释器 从那里开始。

我使用以下命令安装了 tensorflow-0.12.0

python -m pip install --upgrade
https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.12.0-py3-none-any.whl

【问题讨论】:

  • 你是在tensorflow的安装目录下运行python的吗?您使用的是什么操作系统?
  • 我使用的是 Windows 10 专业版(32 位)

标签: python python-3.x tensorflow pip python-import


【解决方案1】:

确保 Tensorflow 支持 Python 3.5.3,然后安装 Microsoft Visual C++ 2015 Redistributable 并尝试此命令(注意,您还需要先卸载当前的 Tensorflow):

python -m pip install --upgrade  https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-0.12.1-cp35-cp35m-win_amd64.whl

更新:转到https://pypi.python.org/pypi/tensorflow 以检查适合您的可用构建。

【讨论】:

  • 它给了我以下错误:tensorflow-0.12.1-cp35-cp35m-win_amd64.whl is not a supported wheel on this platform.
  • 好吧,我似乎没有为 32 位 Windows 找到任何轮子。有没有其他办法。 :-(
  • 好吧,那你应该可以找到一台 64 位机器来使用 Tensorflow,它们只支持 64 位笔记本电脑/台式机。
  • @MelvinAbraham 安装 64 位 Python。 TF 在 32 位模式下不工作。
  • 即使在我的 64 位 Windows 10 中,我也很难安装它。给我同样的错误:...not supported wheel on this platform
猜你喜欢
  • 2020-03-20
  • 1970-01-01
  • 2020-10-28
  • 1970-01-01
  • 2019-07-21
  • 2018-10-03
  • 2021-04-28
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多