TensorFlow | Installation from scratch

In this post we will learn how to install TensorFlow using conda.

Prerequisite

To follow the steps mentioned below, you need to have anaconda installed in your system, If anaconda is not installed follow Anaconda installation steps.

Create conda environment


1. Open the Anaconda Prompt from window search.

anaconda-installation

2. In the prompt type below command to create conda environment named tf_env.

   
conda create --name tf_env python=3.9
 

tensorflow-installation

3. Once the conda environment is created, activate the environment with below command.

   
conda activate tf_env
 

tensorflow-installation

Now we have new conda environment created and activated, lets proceed with TensorFlow installation.

TensorFlow installation


4. To install TensorFlow we have to first update the PIP version, run the below command to update PIP.

   
python -m pip install --upgrade pip
   

tensorflow-installation

5. After the upgrading the pip, install the TensorFlow with following command.

   
pip install tensorflow
 

tensorflow-installation

Verify installation


6. Once the installation is complete run the following commands to verify the installation and to check the installed version.

  • In the prompt type python to enter in Python Shell.
  • In the Python shell type below command to check TensorFlow Version.
  •    
    import tensorflow as tf; print(tf.version.VERSION)
     

    tensorflow-installation