HOW TO INSTALL TENSORFLOW [ (import tensorflow as tf)]

Ashis Kumar Panda
3 min readJan 2, 2018

--

Recently I wanted to learn Tensorflow so I took some time and started focusing on the Tensorflow . In this post I’ll walk you through the installation process of Tensorflow (CPU version).

Here are the simple steps on

How to get started with Tensorflow on Windows?

  • Download Anaconda here and get it installed in your system as per your specifications.
  • After having Anaconda installed , create a virtual environment. To create that open command prompt and type the command
    > conda create -n tensorflow python=3.6
  • This helps in creating a conda environment named as tensorflow having python version 3.6
  • Before we can work with our conda environment that has just been created , we have to activate it using the command below:-
    >activate tensorflow
    We will see the following screenshot in our command prompt
Activating Tensorflow Environment
  • Now to install cpu version of tensorflow inside our created environment use the following command:-
    >pip install — ignore-installed — upgrade tensorflow
    The screen will be populated with all the necessary dependencies that are needed to be downloaded for tensorflow :-
Loading dependencies for Tensorflow
  • Below are the points to check whether we have successfully installed tensorflow :-
  1. In the command prompt start a python session using the command >python
  2. Import the tensorflow package using :-
    > import tensorflow as tf
  3. Check for tensorflow version that has been installed
    > tf.__version__
    Above three steps has been summarized in the snapshot below:-
Check for Tensorflow installation
  • At any point of time if you want to get out of python session use the command
    >quit()
quit()

And we are out of python session.

  • To install any package within the environment use the command (tensorflow)> conda install any_package_name
    where any_package_name is the name of the package you want to install.
  • To work in Jupyter’s interactive environment using tensorflow , use the command
    (tensorflow)> conda install jupyter
  • Once Jupyter is installed we can work with it by activating the Jupyter notebook using the command
    (tensorflow)> jupyter notebook

In my next post , I’ll give a light introduction on how to use Tensorflow.

Untill then Keep Learning, Keep Rocking .

--

--

Ashis Kumar Panda
Ashis Kumar Panda

Written by Ashis Kumar Panda

https://www.linkedin.com/in/ashis-panda/ .. Simplifying tough concepts in Machine Learning domain one at a time| Lifelong learner

Responses (2)