How to Install TensorFlow on Windows

A quick and simple step-by-step guide (with screenshots) for you to install TensorFlow on Windows (CPU) in less than 8 seconds
Install TensorFlow on Windows

If I were to ask to you to describe TensorFlow in just one or two words, what would you say?

Artificial Intelligence. That should sum it all nicely don’t you think so?

It’s what both you and I would answer most of the time when asked upon and don’t get me wrong, you are right.

TensorFlow is one of the many frameworks out there for you to learn more about Deep Learning Neural Networks which is just a small bit-part of Artificial Intelligence as a whole.

It is fairly a simple yet very effective framework for you to tinker with and I’ll get you started with Tensorflow with this quick and simple step-by-step guide. 🙂

 

So what is TensorFlow?

I have included a video for you, from none other than the creators of TensorFlow themselves.

 

 

Let’s jump right in. Also you wouldn’t be needing a Docker or any other virtual machines.

 

 

Before you go on..

Before you go on with the steps, make sure that your computer meets the requirements in order for TensorFlow to work on your computer.

The following are the necessary requirements:

  • TensorFlow only supports 64-bit Python 3.5.x or Python 3.6.x on Windows
  • When you download the Python 3.5.x version, it comes with the pip3 package manager (which is the program that you are going to need in order for you use to install TensorFlow on Windows)

 

 

 

How to Install TensorFlow on Windows: 7 Steps

 

Downloading your Python

So to get started, here’s how you can download the latest 64-bit Python 3.5.x if you have an older version or if you simply don’t have it. 🙂

 

Step 1:  Head over to Python 3.5.x from python.org

 

Step 2:  Go to the Downloads page and Select the 3.5.2 download.

 

Install TensorFlow on Windows

 

 

Step 3:  After that you will be brought to another page, where you will need to select either the x86-64 or amd64 installer.

The one I specifically recommend for now is the Windows x86-64 executable installer.

 

Step 4:  For the purpose of this article I’ll be choosing to Add Python 3.5 to PATH.

 

Step 5:  Now you should be able to see a message saying Setup was successful. A way to confirm that it has installed successfully is to open your Command Prompt and check the version. 🙂

Here’s an example.

 

Install TensorFlow on Windows

 

Sweet! Once you’re done with all that, you can now get onto installing TensorFlow with pip onto your Windows computer.

 

 

If you were wondering what is pip

pip, simply put, is a package management system that is used to install and manage software packages written in Python or in any other words. pip lets you search, download, install, uninstall, and manage 3rd party python packages (pip3 is the latest version which comes with the new Python 3.5.x version that you just had downloaded)

 

For the purpose of this guide I’ll be choosing to install the CPU-only version of TensorFlow, but if you want to download the GPU version by choosing a different  .whl file it’s up to you, but I’ll probably create another guide on that pretty soon for you. 🙂

 

 

Installing your TensorFlow

Now once you have downloaded the latest Python,  you can now put up your finishing touches by installing your TensorFlow.

 

Step 1:  To install TensorFlow, start a terminal.  Make sure that you run the cmd as an administrator.

 

If you do not know how to run your cmd as an administrator …

Here’s how you can run your cmd as an administrator:

Open up the Start menu, search for cmd and then right click on it and Run as an administrator.

 

Install TensorFlow on Windows

 

 

Step 2:  Once you’re done with that, now all you have to do is give just one simple little command for you to finish installing Tensorflow onto your Windows. 🙂

Just enter this command:

C:\> pip3 install --upgrade tensorflow

 

Done? Splendid! You’ll now notice to your top left hand corner with the command prompt saying ‘Administrator’ and that your installation completed successfully.

 

 

Testing your TensorFlow

It’s recommended that you try and test whether your new TensorFlow works smoothly without any such problems.

Here’s an example that you can write to test (you can write absolutely anything).

 

Install TensorFlow on Windows

 

 

34 comments
  1. C:\Windows\system32>pip3 install –upgrade tensorflow

    C:\Windows\system32>echo off
    Please use:
    python -m pip3
    to run this feature
    or:
    python PYTHON_INSTALL_DIR\Scripts\pip3-script.py

    C:\Windows\system32>python -m pip3 install –upgrade tensorflow
    E:\bin\dev\lang\ActivePython 3.6\python.exe: No module named pip3

    C:\Windows\system32>python -m pip install –upgrade tensorflow
    Collecting tensorflow
    Could not find a version that satisfies the requirement tensorflow (from versions: )

    Suggestions on how to use it with ActivePython?

    1. Hey Phil,

      Which version of Python are you using?

      You are going to need the latest 64-bit Python 3.5.x or higher for in order to get TensorFlow.

      So just give that a look, if not you can try to download the latest version of Python from the official website.

      I did take a look at ActivePython, and yes they do have the latest version of Python.

      Although I’m quiet unfamiliar with how ActivePython works, it should work for you if you have the latest version.

      You can also try to enter this in and see if it does the trick

      python3 -m pip install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.12.0-py3-none-any.whl

      1. @Jake —

        awesome for me it got fixed, could you please suggest this tensorflow can be installed the anaconda
        distriution bcoz i got error like a below even after installing the anaconda latest version

        C:\Users\Praful>conda
        ‘conda’ is not recognized as an internal or external command,
        operable program or batch file.

  2. Hi,

    I’m new to Python, so apologies for my immediate ignorance, what is the command to install Tensor flow to utilize my SSE instructions? Based on my errors it looks like I need to include the following into my build: SSE, SSE2, SSE3, SSE4.1, SSE4.2, AVX.

    I’ve read about using some Bazel build or creating a wheel (not too familiar what that is yet, but I’m assuming it’s a custom build). Do I need to add this Bazel thing first before doing the standard Tensorflow install? Or can I do this all in one go with one command line?

    1. Hey Ty,

      Try building with this:
      bazel build -c opt --copt=-mavx --copt=-mavx2 --copt=-mfma --copt=-mfpmath=both --copt=-msse4.2 --config=cuda -k //tensorflow/tools/pip_package:build_pip_package

  3. Hi,

    I am getting this below error. Can you please help?

    ‘pip3’ is not recognized as an internal or external command,
    operable program or batch file.

  4. Hello Jake,

    I installed 3.5.2 version and it says that the setup was successful. But when I try to confirm it says ‘python’ is not recognized as an internal or external command,operable program or batch file.

  5. Hello,
    I have python 3.6.4 version installed. Then I tried “pip3 install –upgrade tensorflow”.
    result – “Could not find a version that satisfies the requirement tensorflow (from versions: )
    No matching distribution found for tensorflow.”

    Please Help!

    1. Which Python Version you have . Tensorflow needs 64bit

      Search ‘ python’ program Check whether it shows Python 3.5 (64 – bit) ?

      Run : pip3 install tensorflow

  6. That’s because Tensor Flow now only supports 64-bit and you have downloaded the 32-bit version of python. The install file you should be using is “python-3.6.4-amd64.exe”. Go to Add/Remove programs and remove the 32-bit version and install the 64-bit version. Then the pip3 command will work fine.

  7. I have completed the process of downloading tensorflow but as soon as I do the command : import tensorflow as tf it gives me: ‘import’ is not recognized as an internal or external command, operable program or batch file

    SOMEONE PLZZ HELP!

    1. you should write first python then once you get the >>> write import the the name of the library you wanna import

  8. Both pip3 install –upgrade tensorflow and pip3 install tensorflow didn’t work for me as follows.
    What shall I do? The cmd was run as admininstrator.
    **********************************************************************************************************
    C:\Windows>pip3 install –upgrade tensorflow
    Requirement already up-to-date: tensorflow in c:\users\mequanent argaw\appdata\local\programs\python\python35\lib\site-packages (1.8.0)
    Requirement not upgraded as not directly required: protobuf>=3.4.0 in c:\users\mequanent argaw\appdata\local\programs\python\python35\lib\site-packages (from tensorflow) (3.5.2.post1)
    Requirement not upgraded as not directly required: tensorboard=1.8.0 in c:\users\mequanent argaw\appdata\local\programs\python\python35\lib\site-packages (from tensorflow) (1.8.0)
    Requirement not upgraded as not directly required: gast>=0.2.0 in c:\users\mequanent argaw\appdata\local\programs\python\python35\lib\site-packages (from tensorflow) (0.2.0)
    Requirement not upgraded as not directly required: astor>=0.6.0 in c:\users\mequanent argaw\appdata\local\programs\python\python35\lib\site-packages (from tensorflow) (0.6.2)
    Requirement not upgraded as not directly required: numpy>=1.13.3 in c:\users\mequanent argaw\appdata\local\programs\python\python35\lib\site-packages (from tensorflow) (1.14.3)
    Requirement not upgraded as not directly required: termcolor>=1.1.0 in c:\users\mequanent argaw\appdata\local\programs\python\python35\lib\site-packages (from tensorflow) (1.1.0)
    Requirement not upgraded as not directly required: grpcio>=1.8.6 in c:\users\mequanent argaw\appdata\local\programs\python\python35\lib\site-packages (from tensorflow) (1.11.0)
    Requirement not upgraded as not directly required: absl-py>=0.1.6 in c:\users\mequanent argaw\appdata\local\programs\python\python35\lib\site-packages (from tensorflow) (0.2.0)
    Requirement not upgraded as not directly required: six>=1.10.0 in c:\users\mequanent argaw\appdata\local\programs\python\python35\lib\site-packages (from tensorflow) (1.11.0)
    Requirement not upgraded as not directly required: wheel>=0.26 in c:\users\mequanent argaw\appdata\local\programs\python\python35\lib\site-packages (from tensorflow) (0.31.0)
    Requirement not upgraded as not directly required: setuptools in c:\users\mequanent argaw\appdata\local\programs\python\python35\lib\site-packages (from protobuf>=3.4.0->tensorflow) (20.10.1)
    Requirement not upgraded as not directly required: werkzeug>=0.11.10 in c:\users\mequanent argaw\appdata\local\programs\python\python35\lib\site-packages (from tensorboard=1.8.0->tensorflow) (0.14.1)
    Requirement not upgraded as not directly required: bleach==1.5.0 in c:\users\mequanent argaw\appdata\local\programs\python\python35\lib\site-packages (from tensorboard=1.8.0->tensorflow) (1.5.0)
    Requirement not upgraded as not directly required: html5lib==0.9999999 in c:\users\mequanent argaw\appdata\local\programs\python\python35\lib\site-packages (from tensorboard=1.8.0->tensorflow) (0.9999999)
    Requirement not upgraded as not directly required: markdown>=2.6.8 in c:\users\mequanent argaw\appdata\local\programs\python\python35\lib\site-packages (from tensorboard=1.8.0->tensorflow) (2.6.11)
    *******************************************************************************
    C:\Windows>pip3 install tensorflow
    Requirement already satisfied: tensorflow in c:\users\mequanent argaw\appdata\local\programs\python\python35\lib\site-packages (1.8.0)
    Requirement already satisfied: grpcio>=1.8.6 in c:\users\mequanent argaw\appdata\local\programs\python\python35\lib\site-packages (from tensorflow) (1.11.0)
    Requirement already satisfied: gast>=0.2.0 in c:\users\mequanent argaw\appdata\local\programs\python\python35\lib\site-packages (from tensorflow) (0.2.0)
    Requirement already satisfied: protobuf>=3.4.0 in c:\users\mequanent argaw\appdata\local\programs\python\python35\lib\site-packages (from tensorflow) (3.5.2.post1)
    Requirement already satisfied: absl-py>=0.1.6 in c:\users\mequanent argaw\appdata\local\programs\python\python35\lib\site-packages (from tensorflow) (0.2.0)
    Requirement already satisfied: termcolor>=1.1.0 in c:\users\mequanent argaw\appdata\local\programs\python\python35\lib\site-packages (from tensorflow) (1.1.0)
    Requirement already satisfied: wheel>=0.26 in c:\users\mequanent argaw\appdata\local\programs\python\python35\lib\site-packages (from tensorflow) (0.31.0)
    Requirement already satisfied: six>=1.10.0 in c:\users\mequanent argaw\appdata\local\programs\python\python35\lib\site-packages (from tensorflow) (1.11.0)
    Requirement already satisfied: astor>=0.6.0 in c:\users\mequanent argaw\appdata\local\programs\python\python35\lib\site-packages (from tensorflow) (0.6.2)
    Requirement already satisfied: numpy>=1.13.3 in c:\users\mequanent argaw\appdata\local\programs\python\python35\lib\site-packages (from tensorflow) (1.14.3)
    Requirement already satisfied: tensorboard=1.8.0 in c:\users\mequanent argaw\appdata\local\programs\python\python35\lib\site-packages (from tensorflow) (1.8.0)
    Requirement already satisfied: setuptools in c:\users\mequanent argaw\appdata\local\programs\python\python35\lib\site-packages (from protobuf>=3.4.0->tensorflow) (20.10.1)
    Requirement already satisfied: markdown>=2.6.8 in c:\users\mequanent argaw\appdata\local\programs\python\python35\lib\site-packages (from tensorboard=1.8.0->tensorflow) (2.6.11)
    Requirement already satisfied: html5lib==0.9999999 in c:\users\mequanent argaw\appdata\local\programs\python\python35\lib\site-packages (from tensorboard=1.8.0->tensorflow) (0.9999999)
    Requirement already satisfied: werkzeug>=0.11.10 in c:\users\mequanent argaw\appdata\local\programs\python\python35\lib\site-packages (from tensorboard=1.8.0->tensorflow) (0.14.1)
    Requirement already satisfied: bleach==1.5.0 in c:\users\mequanent argaw\appdata\local\programs\python\python35\lib\site-packages (from tensorboard=1.8.0->tensorflow) (1.5.0)

  9. I have this problem, can you help me please??
    C:\>pip3 install tensorflow
    Collecting tensorflow
    Could not find a version that satisfies the requirement tensorflow (from versions: )
    No matching distribution found for tensorflow

  10. When I try to install tensorflow I m getting the following error. Can you suggest a way to resolve this issue and install tensor flow ?

    C:\Windows\System32>python -m pip3 install –upgrade tensorflow
    C:\Users\SHM-WS-02\AppData\Local\Programs\Python\Python36\python.exe: No module
    named pip3

    C:\Windows\System32>python -m pip install –upgrade tensorflow
    Collecting tensorflow
    Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None))
    after connection broken by ‘ReadTimeoutError(“HTTPSConnectionPool(host=’pypi.or
    g’, port=443): Read timed out. (read timeout=15)”,)’: /simple/tensorflow/
    Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None))
    after connection broken by ‘ReadTimeoutError(“HTTPSConnectionPool(host=’pypi.or
    g’, port=443): Read timed out. (read timeout=15)”,)’: /simple/tensorflow/
    Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None))
    after connection broken by ‘ReadTimeoutError(“HTTPSConnectionPool(host=’pypi.or
    g’, port=443): Read timed out. (read timeout=15)”,)’: /simple/tensorflow/
    Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None))
    after connection broken by ‘ReadTimeoutError(“HTTPSConnectionPool(host=’pypi.or
    g’, port=443): Read timed out. (read timeout=15)”,)’: /simple/tensorflow/
    Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None))
    after connection broken by ‘ReadTimeoutError(“HTTPSConnectionPool(host=’pypi.or
    g’, port=443): Read timed out. (read timeout=15)”,)’: /simple/tensorflow/
    Could not find a version that satisfies the requirement tensorflow (from versi
    ons: )
    No matching distribution found for tensorflow

  11. Hi I have installed python in windows and while I am installing tensorflow the following error is displayed, Is there any way to resolve this issue?

    C:\>python version
    Python 3.5.2

    C:\>pip –version
    pip 8.1.1 from c:\users\tony\appdata\local\programs\python\python35\lib\site
    -packages (python 3.5)

    C:\>pip3 install tensorflow
    Collecting tensorflow
    Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connec
    tion broken by ‘NewConnectionError(‘: Failed to establish
    a new connection: [Errno 11004] getaddrinfo failed’,)’: /simple/tensorflow/
    Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connec
    tion broken by ‘NewConnectionError(‘: Failed to establish
    a new connection: [Errno 11004] getaddrinfo failed’,)’: /simple/tensorflow/
    Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connec
    tion broken by ‘NewConnectionError(‘: Failed to establish
    a new connection: [Errno 11004] getaddrinfo failed’,)’: /simple/tensorflow/
    Retrying (Retry(total=1, connect=None, read=None, redirect=None)) after connec
    tion broken by ‘NewConnectionError(‘: Failed to establish
    a new connection: [Errno 11004] getaddrinfo failed’,)’: /simple/tensorflow/
    Retrying (Retry(total=0, connect=None, read=None, redirect=None)) after connec
    tion broken by ‘NewConnectionError(‘: Failed to establish
    a new connection: [Errno 11004] getaddrinfo failed’,)’: /simple/tensorflow/
    Could not find a version that satisfies the requirement tensorflow (from versi
    ons: )
    No matching distribution found for tensorflow

  12. My installation was complete sucessfully but when I tryied the example the message ”
    Traceback (most recent call last):
    File “”, line 1, in
    ModuleNotFoundError: No module named ‘tensorflow’

    I don’t know what I did wrong in my installation.

  13. import tensorflow as if
    File “”, line 1
    import tensorflow as if
    ^
    SyntaxError: invalid syntax
    ………………………………………………………………………………… i have tried the above mentioned code..whats a issue in installation?

  14. So hello there, we got troubles in installing of tensorflow. We did everything right, like everybody write in instructions, but we have always 1 error. In CMD line we see “failed to load the native Tensorflow runtime”. We tried to do everything, but nothing helps. Pls help

  15. when I entered the command pip install tesorflow it is showing this error
    ERROR: Could not find a version that satisfies the requirement tensorflow (from versions: none)
    ERROR: No matching distribution found for tensorflowERROR: Could not find a version that satisfies the requirement tensorflow (from versions: none)
    ERROR: No matching distribution found for tensorflow
    Help me install this package

  16. Hi,
    While installing tensorflow with the pip3 install –upgrade tensorflow, I got the following message : any idea how to get around it ? I am jusing Python 3.6.5: Anaconda. Many thanks.

    ERROR: Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: ‘C:\\Users\\pierr\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python37\\site-packages\\tensorflow_estimator\\python\\estimator\\canned\\linear_optimizer\\python\\utils\\__pycache__\\sharded_mutable_dense_hashtable.cpython-37.pyc’

Leave a Reply

Your email address will not be published. Required fields are marked *

Next Post
Slow Internet on Windows 10

10 Shit-Easy Ways to Fix Slow Internet on Windows 10

Related Posts