Anaconda, TensorFlow Pycharm install and configure detailed tutorial, effective pro-test!


This tutorial is for personal learning use, not for commercial profit, resulting in at your peril! ! !


1, Anaconda download and install

(1) Anaconda download URL: https://www.anaconda.com/distribution/ , according to the median its own system, and the system, select the desired version. Here is my Windows64-bit systems.
Here Insert Picture Description
(2) download, select the installation package, click the Next
Here Insert Picture Description
(3) Select the "I agree" option
Here Insert Picture Description
(4) you can select Just Me
Here Insert Picture Description
(5) Click the Select installation path "Browse", the next step is to wait for the installation, the installation very Fast.
Here Insert Picture Description
At the end of (6) the progress bar, select the next button
Here Insert Picture Description
(7) unchecked, then click on the "Finish" button to complete the installation.
Here Insert Picture Description
***

2, Anaconda installation test success

(1) into the Windows system interface cmd: Then enter: conda --versionCheck the version of the anaconda
Here Insert Picture Description
(2) Check the currently installed what environment variables: conda info --envs, as is the success shown
Here Insert Picture Description
***

3, install python

(1)需要安装一个Python解译器,可以使用conda search --full -name python(Anaconda如果比较新的版本,可以使用conda search --full --name python)检查支持的Python版本。我安装的就是比较新的版本,所以使用的是conda search --full --name python检查Python版本
Here Insert Picture Description
(2)安装Python解译器:conda create --name tensorflow python=3.6,我安装的是3.6版本,你可以根据自己需要安装自己的需要选择版本。(为了不出错,建议你也安装3.6版本)
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description
***

4、检查TensorFlow环境添加成功与否

(1)激活tensflow的环境:activate tensorflow
Here Insert Picture Description
(2)检测tensflow的环境添加到了Anaconda里面:conda info --envs
Here Insert Picture Description
(3)退出tensorflow的环境:deactivate tensorflow不过这里不需要退出哈,因为我们要进行TensorFlow安装
***

5、TensorFlow安装

前提: 在激活TensorFlow情况下(即前边有tensorflow字样),如果没有激活,需使用:activate tensorflow进行激活
(1)使用如下命令进行安装TensorFlow:pip install --upgrade --ignore-installed tensorflow,等待安装就可以了。
提示: 如果提示需要你升级你的pip的版本,那么你就根据上面的提示进行命令安装就可以了。我这里就遇到了,所以我升级了版本:python -m pip install --upgrade pip
Here Insert Picture Description
(2)安装TensorFlow:pip install --upgrade --ignore-installed tensorflow
Here Insert Picture Description
***

6、测试TensorFlow安装是否成功

(1) Open Anaconda previously installed, selecting prompt
Here Insert Picture Description
(2) used activate tensorflowto switch to tensorflow environment
Here Insert Picture Description
(3) enter pythoninto the Python build environment
Here Insert Picture Description
(4) successively enter the following command:

import tensorflow as tf
hello = tf.constant('hello,tf')
sess = tf.Session()
print(sess.run(hello))

Here Insert Picture Description
(5) The results shown below indicate the test was successful:
Here Insert Picture Description
***

7, arranged to Pycharm TensorFlow

After installing TensorFlow, we need the corresponding Python interpreter configured to Pycharm in to be able to carry out the implementation of the program, the configuration steps are as follows:
(1) Open Pycharm, click settings under the "file" menu
Here Insert Picture Description
(2) Click "Project: Pycharm "in the" Project Interpreter ", click on the right under the small triangle" Add "button to add the Python install under TensorFlow
Here Insert Picture Description
later (3) configured, enter the following code:

import tensorflow as tf

hello = tf.constant('hello,tf')
sess = tf.compat.v1.Session()
print(sess.run(hello))

Here Insert Picture Description
Results of the:
Here Insert Picture Description

Guess you like

Origin www.cnblogs.com/CVLianMeng/p/11589013.html