You need to use the right version of Python and pip
.
On Windows 10, with Python 3.6.X version I was facing the same problem, then after checking deliberately I noticed I had the Python-32 bit installation on my 64 bit machine. Remember TensorFlow is only compatible with 64bit installation of Python, not the 32 bit version of Python
If we download Python from python.org, the default installation would be 32 bit. So we have to download the 64 bit installer manually to install Python 64 bit. And then add below to PATH
environment.
C:\Users\AppData\Local\Programs\Python\Python36
C:\Users\AppData\Local\Programs\Python\Python36\Scripts
Then run gpupdate /Force
on command prompt. If the Python command doesn't work for 64 bit then restart your machine.
Then run python on command prompt. It should show 64 bit.
C:\Users\YOURNAME>python
Python 3.6.3 (v3.6.3:2c5fed8, Oct 3 2017, 18:11:49) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
Then run below command to install tensorflow CPU version (recommended)
pip3 install --upgrade tensorflow
October 2020 update:
Tensorflow now supports Python 3.5.x through Python 3.8.x, but you still have to use a 64-bit version.
If you need to run multiple versions of Python on the same machine, you can use a virtual environment to help manage them.
pip install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.0.1-py2-none-any.whl
code'$ pip install --upgrade TF_BINARY_URL # Python 2.7 $ pip3 install --upgrade TF_BINARY_URL # Python 3.N
code`