Installation anaconda3 and tensorflow

First, install anaconda

Here are installing Anaconda3-2019.03-Windows-x86_64.exe (python3.7 version)

Second, check the installation environment

1, if the anaconda installation checked configuration environment variable, direct cmd; if not checked, enter the Anaconda Prompt window (recommended)

2, detection anaconda environment is installed successfully:

conda --version

3, which detects the current installation environment:

conda info --envs

Third, the installation tensorflow in the anaconda

1, create tensorflow environment, install python3.7:

conda create --name tensorflow python=3.7

Note: tensorflow here is their definition of the name of the environment, corresponding to the anaconda installation directory envs folder.
Note: Due to Tsinghua University and other units anaconda mirror sites without obtaining authorization led to the closure, there is no replacement anaconda repository mirroring, you can use the default.
Note: If the download is interrupted due to network instability, try again.

2, the environment detection tensorflow Anaconda added to the inside:

conda info --envs

3, activation tensorflow environment (important, and then activate the next step):

source activate tensorflow

Note: This corresponds to the name of the environment tensorflow Step 1.
Note: Deactivation with conda deactivate

4, installation tensorflow:

pip install --upgrade --ignore-installed tensorflow

Note: Changing the pip download the source can improve download speeds. In C: \ Users \ username \ pip New pip.ini file folder:

[global]
index-url = https://mirrors.aliyun.com/pypi/simple/
[install]
trusted-host = mirrors.aliyun.com

Fourth, verify that the normal installation

1, in tensorflow environmental inputs: Python
2, the progressive input:

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

3, print: b'hello, tf ', is the normal installation.

Guess you like

Origin www.cnblogs.com/steven0325/p/11005342.html