Windows下安装python3.5+tensorflow
CPU模式tensorflow在window10上安装,虽然和别人的大同小异,但是,在安装过程中总是遇到一些问题,觉得还是记下来好一些:
Step1: Python 官网下载python 3.5.2版本的exe安装包,链接:https://www.python.org/downloads/release/python-352/ 安装过程中注意勾选将python路径添加到环境变量中;
Step2: 在cmd 中输入python 看能否显示python的版本信息,如果能够显示则说明正确安装,否则出错;
Step3: 由于python 3.5.2本身包含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