We will install Tensorflow using Python virtual environment.

Note: This installation does not include support for GPU acceleration.

Setup Python 3

sudo apt-get update
sudo apt-get -y upgrade
sudo apt-get install gcc libpq-dev -y
sudo apt-get install python-dev python-pip -y
sudo apt-get install python3-dev python3-pip python3-venv python3-wheel -y
apt-get install build-essential libssl-dev libffi-dev -y
pip3 install wheel

You can also use Anaconda to setup the virtual environment. Check out how to install Anaconda

Setting Up Python Virtual Environment

mkdir ~/tf-venv
cd ~/tf-venv
python3 -m venv tensorflow-dev
pip3 install --upgrade tensorflow

Validating Installation

Run following command to check Tensor flow version ...

python -c 'import tensorflow as tf; print(tf.__version__)'