3中导入tensorflow问题

3中导入tensorflow问题

本文介绍了在Python 3.5.3中导入tensorflow问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在 Python 3.5.3 中导入tensorflow时,会显示以下内容:

When I import tensorflow in Python 3.5.3, it gives me following:

错误:

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

Unless you are using bazel, you should not try to import tensorflow from its source directory; please exit the tensorflow source tree, and relaunch your python interpreter from there.

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

I installed tensorflow-0.12.0 using the following command:

推荐答案

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

Make sure that Python 3.5.3 is supported for Tensorflow, then install Microsoft Visual C++ 2015 Redistributable and try this command (note that you also need to uninstall the current Tensorflow first):

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 检查适用于您的可用建筑物.

Update: Go to https://pypi.python.org/pypi/tensorflow to check for available built that works for you.

这篇关于在Python 3.5.3中导入tensorflow问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-19 09:51