1. Normal TensorFlow installation process

(1) Check your computer system version and Python version

  • Check the computer system version: 32bit/x86-64bit, we will not be their own Baidu

  • To view the Python version, you can enter the command in the terminal:

python -V
Copy the code

(2) install tensorflow

Run the following command to install:

pip install tensorflow
Copy the code

2. Possible problems during installation

(1) The Python version is too high to be supported by TensorFlow

This problem is common because TensorFlow is a Python library, which often has difficulty supporting the latest Python language. For example, if your system is python3.7 by default, but TensorFlow supports Python3.6 at most, the following problems may occur during installation:

   Could not find a version that satisfies the requirement tensorflow (from versions; )
No matching distribution found for tensorflow
Copy the code

To avoid this problem, it is recommended that you check tensorFlow’s current python versions in the TensorFlow configuration list before installing TensorFlow.

  • Note: Currently (as of 20180830), the highest Python version supported by TensorFlow is PYTHon3.6.

After reviewing, if the Python version of your system is too high, you can install a lower version of Python at this point, such as Python3.6, and then set up tensorFlow under Python3.6. To set the environment, run the following command (anaconda is installed) :

Conda create -n p36 python=3.6 # create python environment source activate P36 # activate python3.6 environmentCopy the code

If successfully activated, the terminal will appear py36:

(py36)root@dawn-inspiron-7472:/usr/lib#
Copy the code

You can then follow the normal TensorFlow installation process.

After installation, deactivate the Py36 environment:

soucrce deactivate
Copy the code

I only found this problem for the time being, I will continue to update this post as I encounter more problems…

3. Test that TensorFlow is successfully installed

We type Python on the command line, open the Python statement environment, and type:

01    >>> import tensorflow as tf
02    >>> hello = tf.constant("Hello World, TensorFlow!")
03    >>> sess = tf.Session()
04    >>> print(sess.run(hello))

# output: b'Hello World,TensorFlow! '
Copy the code

If the output is correct, your tensorFlow is installed successfully!