您的位置:首页 > 编程语言 > Python开发

Window10 + tensorflow 安装(解决Error importing tensorflow, unless you are using bazel...)

2017-03-26 15:14 721 查看
CPU模式tensorflow在window10上安装,虽然和别人的大同小异,但是,在安装过程中总是遇到一些问题,觉得还是记下来好一些:

Step1: python 官网下载python 3.5版本的exe安装包,安装过程中注意勾选将python路径添加到环境变量中;

Step2: 在cmd 中输入python 看能否显示python的版本信息,如果能够显示则说明正确安装,否则出错;

Step3: 由于python 3.5本身包含pip,只需要进行更新即可,更新方式如下:开始-> 运行-> cmd -> "python -m pip --upgrade pip" (无双引号);

Step4: 在cmd中输入"pip install tensorflow",然后等待安装即可,如果由于网络问题导致安装不成功,重新输入“pip install tensorflow”即可

注意: 我自己在安装的过程完成后,导入tensorflow时总是提示如下问题:

Error importing tensorflow. Unless you are using bazel.

you should not try to import tensorflow from its source directory;

please exit teh tensorflow source tree, and relaunch your python interpreter from there.

解决方法: 下载Windows 的 Microsoft Visual C++ 2015 redistributable update 3 64bit 安装即可

下载路径:https://www.microsoft.com/zh-cn/download/confirmation.aspx?id=53840

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  python 机器学习
相关文章推荐