Install TensorFlow on Windows

Reading Time: 2 minutes

Whether you’re a beginner or a professional, TensorFlow is an end-to-end platform that makes building and deploying Machine Learning models a snap! Because TensorFlow is based on the Python system, you can install it on multiple operating systems, including Windows. This article will take you through the necessary steps to get TensorFlow installed on your Windows server.

The easiest way to install TensorFlow is to use the package manager PIP for Python. If you need help installing Python, see How To Install Python on Windows. To get PIP installed, see How To Install Pip on Windows. Now that you’ve got the basic tools installed, you can proceed with installing TensorFlow.

Set-up Your Python Development Environment

The best way to install TensorFlow is inside of a virtual environment. This ensures that you won’t cause any problems with your existing system environment. To set up the virtual environment, you should first check to verify that you have at least Python 3.4 and PIP 19 versions installed, as well as the virtual environment tool (virtualenv).

Verify versions of each tool by running these commands:

python --version
pip --version
virtualenv --version

If Python or PIP are not installed, follow the directions in the linked articles above to install. To upgrade PIP, run this command:

pip install --upgrade pip

If virtualenv is not installed, run this command:

pip install -U pip virtualenv

Create a Virtual Environment

Now that you have the necessary tools in place, you can create a virtual environment in which to run TensorFlow. This is the recommended approach as it protects the rest of your system for possible issues by only making changes within the virtual environment itself.

Create a virtual environment by choosing a Python interpreter and creating a .\venv directory using this command:

 virtualenv --system-site-packages -p python ./venv

We can then activate the virtual environment by running:

.\venv\Scripts\activate

This should change your command prompt to (venv) c:\>

Next, let’s check for the installed packages with the following command:

(venv) c:\>pip list

You can leave the virtual environment later with the command:

deactivate

NOTE: don’t leave the virtual environment until you are done installing TensorFlow

Install the TensorFlow PIP Package

With the virtual environment set up and activated, you can install TensorFlow using PIP with this simple command:

(venv) c:\> pip install --upgrade tensorflow

And that’s it! TensorFlow is now installed and ready for you to begin developing your Machine Learning models.

Author Bio

About the Author: David Richards

David Richards has been an educator, a technology director, and now a Windows administrator for 20+ years. He’s an English major with a love for technology and helping others find ways to use technology more effectively. In his free time, Dave loves to read, play games, and spend time his family.

Get 33% off the first 3 months on a new Dedicated server! Find out why 30,000 customers have chosen our Best-in-Class Performance & 24x7x365 Support