Current environment: WIN10, anaconda2,python2.7
Objective: To install TensorFlow without affecting the current software environment
Currently TensorFlow only supports the Python 3.5 version under Windows, and I only have python2.7 on my system. Installing TensorFlow requires a Python dependency pack, so I chose to install the Anaconda 3 version, which eliminates the hassle of installing additional packages. Because a lot of work still need to use python2.7, so finally choose to implement ANACONDA2 and Anaconda3 multiple versions coexist, finally, then install TensorFlow.
The specific steps are as follows:
STAGE1: Installing multiple versions of Anaconda or Python
Step1: The existing Anaconda2 as the main version, download the sub-version of the Anaconda3 EXE file, pay attention to cover the python3.5 version;
Step2: Install Anaconda3, where the Anaconda3 installation directory must be selected under *\anaconda2\envs subdirectory and define the name of the installation file, such as: Py3, and the last installation path becomes: *\anaconda2\envs\py3, Complete the installation.
Note: In the installation process, "Addanaconda to my PATH environment variable" and "Regster Anaconda as my defaultpython3.5" can be unchecked, the ANACONDA2 has been set, You do not need to change the settings.
Step3: Toggle python version
(1) CMD command directly input python will start python2.7;
(2) The use of Activate Py3 can enable python to switch to python3.5, then use any Python command is under Python3;
(3) Use the Deactivate command to cancel the activation of the Python3;
(4) Spyder to switch Python3: First in the cmd inside activate Py3, before the appearance (PY3), and then enter the Spyder carriage return on the line
(5) When specifying a different Python version in Pycharmide, the method is set as follows:
File->setting->project:xxxx->projectinterpreter choose Python in a different location.
Stage2: Install CPU version of TensorFlow
Installation method:
Step1: Press the above method, switch to (PY3), run the PIP directly to install, as follows:
Pip Install--upgrade--ignore-installed https://storage.googleapis.com/tensorflow/windows/cpu/ Tensorflow-0.12.0rc0-cp35-cp35m-win_amd64.whl
Attention:
(1) You may receive an error when you have just installed:
Permissionerror: [Errno] Permission denied: ' D:\\usr\\anaconda2\\......,anaconda installed, restart the computer, run the above statement can be resolved;
(2) In addition, it is said that--ignore-installed must be added, otherwise it will be an error.
STEP2: Detect if Installation succeeded: Import TensorFlow as TF
Resources:
[1] http://blog.csdn.net/ljp812184246/article/details/52593024
[2] Https://zhuanlan.zhihu.com/p/24055668?refer=wjdml