How to Install TensorFlow?

If you are wondering how to install TensorFlow effectively, don’t worry. We have covered using this straightforward yet practical approach to install TensorFlow on Windows machines. This article will not only provide an installation walkthrough, still, it will also include prerequisites and theory to get started on what TensorFlow is and the minimum requirements to run TensorFlow on Windows machines. By the end of this article, you will be able to install TensorFlow, python, virtual environment and much more. So Let’s start.

Tensorflow is a Free and Open source library for Artificial Intelligence and Machine Learning. With the help of TensorFlow, it becomes very convenient to make machine learning models trained on enormous datasets for classification/prediction, etc, tasks.

 Table of Contents

Prerequisites To Install TensorFlow

These are the minimum requirements you must have to install TensorFlow on your system:

  • Windows 7 or higher (64-bit).
  • Python 3.8–3.11.
  • pip version 19.0 or higher.
  • Windows Native Requires Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 or 2019.
Want to enrich your career and become a professional in TensorFlow? Then enroll in TensorFlow Online Training. This hands-on course will help you to achieve excellence in this domain.

Steps To Install Python TensorFlow on Windows

Let’s get started by installing Python first. If you have Python installed, you can directly skip to Step 10.

Step 1: Visit the official Python website via https://www.python.org/downloads/ 

 

Python download

 

Step 2: Click on download python, whichever is the latest version. If you need any specific version, then do hit https://www.python.org/downloads/windows/

 

Python latest version

 

Step 3: Save the .exe file on the local machine as per your requirement.

 

Save .exe file

 

Step 4: Open the .exe file.

 

Open .exe file

 

[ Learn Complete TensorFlow Tutorial For Beginners ]

 

Step 5: Click on Add python.exe to PATH as this option helps us to automatically set the python.exe path to environment variables, so it helps to use Python from anywhere in your system. If you don’t select this option, you must manually add the path, which is a complex process.

Add python .exe file to path

 

Step 6: Installation in Progress.

 

Installation in progress

 

Step 7: Installation is successful. Just close this window.

 

Installation successful

 

Step 8: To verify the Python installation, type the Windows+r key so it will open the dialog box. Just enter cmd and hit ok. Or you can directly search for the command prompt in Windows search.

 

command prompt

 

Step 9: Once the command prompt is opened, just type in the command python –version or py –version and hit enter. If you see the version, you successfully installed Python on your system.

 

py version

 

What is a Virtual Environment?

The virtual environment is a Python environment in which all the installed libraries and scripts are limited to that environment only. It doesn’t interfere with the system’s libraries. As a result, no conflicts are raised due to version mismatch and all.
Therefore, it is advised to do it in a virtual environment when running the Python project.

Setting Up the Virtual Environment:

Step 10: Let’s Download the Library first, then create and activate the environment. To install the virtual environment, type pip install virtualenv, and to create the environment, type virtualenv environment_name followed by change the directory to cd environment_name/scripts and then enter and type activate so as you can see in the last, before the root directly our environment, i.e. (tensorflow) is running successfully.

 

Virtual environment

Installation of TensorFlow on Windows

Step 11: Let’s download TensorFlow. To download TensorFlow, type the command pip install TensorFlow.

 

Install TensorFlow

 

TensorFlow installed

 

Step 12: As TensorFlow got successfully installed, now let’s verify it. To verify the TensorFlow, open the Python interpreter by typing python. After the successful opening of the interpreter, type the code import tensorflow as tf if you see no error after importing TensorFlow. Bingo, it got installed successfully, and to check its version type in print(tf.__version__), you will be able to see the version of TensorFlow that got installed.

 

Verify TensorFlow

To close the Python interpreter, type ctrl + z, hit enter, then deactivate to deactivate the virtual environment.

 

Learn TensorFlow Interview Questions and Answers that help you grab high-paying jobs

 

TensorFlow Installation FAQs

1. How do I install TensorFlow on Windows?

You need to install Python on your system to install TensorFlow. After installing Python, open the command prompt, run the command pip install tensorflow, and verify your installation in the Python environment.

2. Does TensorFlow support 64-bit systems?

Yes, Tensorflow is compatible with 64-bit systems. You can install it through Python’s pip package manager. There are official packages available for Windows, macOS, and Ubuntu.

3. What software do I need to run TensorFlow?

You need to have a Python environment with a 3.5 version or later. CUDA Toolkit: CUDA 9.0 is also required to run TensorFlow. Libraries like LIMP or SHAP are also required to perform model explanations.

4. What happens if TensorFlow fails to release the pip package?

If pic packages fail to be released, users won’t receive any updates for bug fixes or new features. Collaborations may be hindered, and security issues may arise, leading to trust issues.

 

Conclusion

In this tutorial, we saw how to install TensorFlow on a Windows machine. Initially, we started with Python installation, then the setting up of the virtual environment, followed by installing TensorFlow.It was the easiest way to install TensorFlow on a Windows machine.

Course Schedule
NameDates
TensorFlow TrainingJul 23 to Aug 07View Details
TensorFlow TrainingJul 27 to Aug 11View Details
TensorFlow TrainingJul 30 to Aug 14View Details
TensorFlow TrainingAug 03 to Aug 18View Details
Last updated: 21 Sep 2023
About Author

Viswanath is a passionate content writer of Mindmajix. He has expertise in Trending Domains like Data Science, Artificial Intelligence, Machine Learning, Blockchain, etc. His articles help the learners to get insights about the Domain. You can reach him on Linkedin

read less