706

I'm trying to install TensorFlow using pip:

$ pip install tensorflow --user
Collecting tensorflow
Could not find a version that satisfies the requirement tensorflow (from versions: )
No matching distribution found for tensorflow

What am I doing wrong? So far I've used Python and pip with no issues.

pppery
  • 3,731
  • 22
  • 33
  • 46
  • 19
    try this: `pip install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.0.1-py2-none-any.whl ` – lkahtz Mar 24 '17 at 13:02
  • 3
    The correct way to install it would be `code'$ pip install --upgrade TF_BINARY_URL # Python 2.7 $ pip3 install --upgrade TF_BINARY_URL # Python 3.N`code` – Rahul Thakur Apr 07 '17 at 05:03
  • I had this issue too, but realized I was trying to install tensorflow via the 32-bit version(no idea why I had installed that one). Make sure you have the right version for your system and the software you're aiming to install. – Jonathan Rys Nov 17 '17 at 02:09
  • 48
    For me this happens with python 3.7, After hours of struggle I used 3.6 and that worked. – clankill3r Sep 07 '18 at 22:59
  • Do `easy_install -U pip` before installing tensorflow. See https://www.tensorflow.org/install/install_mac. – saubhik Sep 13 '18 at 10:15
  • 5
    Use Anaconda for tensorflow installation – saket Sep 16 '18 at 18:53
  • as @clankill3r mentioned, always make sure you are using a supported version of python in the current Keras version, see https://keras.io/. If your python version is not supported, then do `conda create -n projectname`, `activate projectname`, `conda install python=X.X`, and `pip install tensorflow` where `X.X` is a suppurted python version. – havij Jan 22 '19 at 05:04
  • Actually, it is an error bcoz you might be using newest version of the Python. Downgrade it, you will see result. – Yash Mar 06 '19 at 19:30
  • Possible duplicate of [Can't install tensorflow with pip or anaconda](https://stackoverflow.com/questions/51440475/cant-install-tensorflow-with-pip-or-anaconda) – Siddharth Das May 06 '19 at 14:22
  • @saket Anacoda has troubles with it as well. At least for now, July 2019, it does not automatically install tensorflow on Python 3.7 – TomateFraiche Jul 18 '19 at 15:29
  • I confirm this happens (or at least used to happen, I am not up to date) with Python versions higher than 3.6. To install an alternative Python version for Tensorflow alongside your standard one, have a look [here](https://stackoverflow.com/a/52412031/5663986). – belvederef Nov 17 '19 at 09:25
  • See Tensorflow isse #33374: [can't install with python3.8](https://github.com/tensorflow/tensorflow/issues/33374) – Martin Thoma Mar 19 '20 at 12:29
  • 7
    Currently facing the same problem in Python3.9 . In python3.8 , it works fine – Jdeep Oct 26 '20 at 10:11
  • I had the same issue when using 3.9.. Using 3.7 worked for me – Mike3355 Nov 27 '20 at 12:21
  • Use a VENV and upgrade pip with `pip install --upgrade pip` – domih Mar 16 '21 at 22:16
  • mine was proxy issue, had to add --trusted-host storage.googleapis.com – lejencodes Apr 25 '21 at 15:23

61 Answers61

864

I found this to finally work.

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

Edit 1: This was tested on Windows (8, 8.1, 10), Mac and Linux. Change python3 to python according to your configuration. Change py3 to py2 in the url if you are using Python 2.x.

Edit 2: A list of different versions if someone needs: https://storage.googleapis.com/tensorflow

Edit 3: A list of urls for the available wheel packages is available here: https://www.tensorflow.org/install/pip#package-location

halfer
  • 19,824
  • 17
  • 99
  • 186
Yash Kumar Verma
  • 9,427
  • 2
  • 17
  • 28
  • 65
    This may be the right answer, but users please note that this command is for Mac only, not linux. – penta Apr 09 '17 at 16:26
  • 14
    That's is wierd. As the URL which u have specified mentions Mac & if you try to use this url it will install. But tensorflow will actually not work. – penta Apr 12 '17 at 14:44
  • 12
    The windows version of the URL (for v.1.2.1) is https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.2.1-cp35-cp35m-win_amd64.whl. This **only** works with the AMD64 version of Python. A full list of tensorflow versions is here: https://storage.googleapis.com/tensorflow – c2huc2hu Jul 11 '17 at 03:27
  • 2
    `tensorflow` only supports python 64-bit. You might be using 32-bit installation. Install 64-bit python and it works with `pip install tensorflow` directly. Refer to the correct answers below before trying this approach. – Prashanth Mar 11 '18 at 10:42
  • Above command gave me SSL error on MacOS and updating command like the following worked: python3 -m pip install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.12.0-py3-none-any.whl --trusted-host files.pythonhosted.org --trusted-host pypi.org --trusted-host pypi.python.org – Hemant Nov 21 '18 at 04:56
  • 2
    You can find the respective storage link here: https://www.tensorflow.org/install/pip – SadSeven Dec 15 '18 at 06:44
  • Works on Ubuntu 14. – Camille Goudeseune Jan 14 '19 at 18:38
  • 1
    For anyone running windows / anaconda / python 3.7x, tensorflow only works up to python 3.6.8. `conda install tensorflow` works, but will downgrade to python 3.6.8. the above will seem to work but throw a problem when trying to `import tensorflow` for python 3.7x, so if no pip install works, try downgrading to python 3.6 – Freya W Jan 29 '19 at 12:51
  • For the latest version: Tensorflow 1.14. `pip3 install --upgrade setuptools` `pip3 install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.14.0-py3-none-any.whl` – leenremm Aug 08 '19 at 08:22
  • 1
    Thanks so much! However it only worked for me when i changed the `python3` to `py` – Jarrett Dec 19 '20 at 13:22
  • On an M1 Mac, launch Terminal using Rosetta and this will work. – Grace Thompson Sep 01 '21 at 05:25
  • I tried this, but still getting "ERROR: No matching distribution found for tensorflow". I'm on 64 bit python – mikey Dec 29 '22 at 14:04
  • It is also works for Python - 3.10.6. – baponkar Jan 22 '23 at 07:41
331

You need a 64-bit version of Python and in your case are using a 32-bit version. As of now Tensorflow only supports 64-bit versions of Python 3.5.x and 3.8.x on Windows. See the install docs to see what is currently supported

To check which version of Python you are running, type python or python3 to start the interpreter, and then type import struct;print(struct.calcsize("P") * 8) and that will print either 32 or 64 to tell you which bit version of Python you are running.

From comments:

To download a different version of Python for Windows, go to python.org/downloads/windows and scroll down until you see the version you want that ends in a "64". That will be the 64 bit version that should work with tensorflow

Pikamander2
  • 7,332
  • 3
  • 48
  • 69
rocket1037
  • 3,351
  • 1
  • 10
  • 5
  • 34
    >>> import platform;print(platform.architecture()) ('64bit', 'WindowsPE') but still I am seeing this exception – Sujoy Mar 01 '17 at 16:43
  • 2
    Suspicious of the "top" answer; this seems simple, intuitive, fast and safe by comparison. Tested ok with Python 3.6.4 on Windows 7. – omatai Feb 19 '18 at 22:06
  • The trick is not to use the big yellow download buttons, but to go into the specific release page and select the x86-64 installer. The yellow download button only downloads the x86 version, and you need the 64-bit version to install TensorFlow. – Neo Mar 16 '18 at 23:31
  • 4
    To check which version of Python you are running, type `python` or `python3` to start the interpreter, and then type `import struct;print(struct.calcsize("P") * 8)` and that will print either 32 or 64 to tell you which type you are running. – Pro Q Jun 22 '18 at 15:37
  • 1
    To download a different version of Python for Windows, go to https://www.python.org/downloads/windows/ and scroll down until you see the version you want that ends in a "64". That will be the 64 bit version that should work with tensorflow. – Pro Q Jun 22 '18 at 15:46
  • 1
    Would be great to have the answer by @ProQ included in the answer. I searched SO on how to determine which type I was running before I noticed that comment. – Niellles Jul 09 '18 at 17:11
  • 1
    I got the error even though this command yielded "64" for me. – JakeJ Aug 26 '18 at 11:47
  • 27
    My problem turned out to be that Tensorflow at this time does not yet support Python 3.7 (it supports up to 3.6.x). After doing more reading through Github issues where it has been requested, it seems support will probably be out soon. – JakeJ Aug 26 '18 at 12:55
  • on linux with python 3.7 it is not this issue. I have 64 and still can't install tensorflow. After switching to 3.6 is ok. – karol Sep 07 '18 at 20:29
  • 4
    Are the supported python versions documented anywhere? – rob Oct 25 '18 at 19:41
  • 1
    Yes @rob on the install page https://www.tensorflow.org/install – Liam Mar 06 '20 at 14:45
  • I had the same issue and it was because I initially installed 32-bit. I resolved it by replacing it with 64 bit. Download the Python from https://www.python.org/downloads/release/python-385/ and choose 'Windows x86-64 executable installer' – Swinkaran Sep 16 '20 at 23:50
  • 1
    @rob, I think a better link for finding the supported python versions is this one: https://www.tensorflow.org/install/source (@liam's link only shows the compatibility for the latest version of tensorflow, in many cases it's necessary to know the compatibility for other versions.) – craq Jan 11 '21 at 22:35
90

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

Image

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.

Null
  • 1,950
  • 9
  • 30
  • 33
Morse
  • 8,258
  • 7
  • 39
  • 64
  • While providing a link that may answer the question is fine, but it will be better if you can also include the necessary explanation here in the answer itself. Link may not work in the near future for any number of reasons say author removes/changes the pages, etc. – n4m31ess_c0d3r Nov 30 '17 at 21:37
  • 6
    I did not realise I had installed Python 3.6.x 32-bit version on my 64-bit machine. Need to uninstall that and follow your instruction in this post. All works now. Thank you! – yangli.liy Feb 04 '18 at 10:51
  • 2
    Thanks. To simplify this answer 2 points helped me 1.) use 64 bit version. 2.) Only python 3.5 and 3.6 are supported. Don't try use 3.7 – Harry Jan 10 '19 at 14:29
  • Thanks for the Oct 2020 update - I successfully installed tensorflow on python 3.8.5 – Talon Oct 08 '20 at 09:48
  • No support for python 3.9 so if that's your version your sol atm. – Björn Lindqvist Dec 04 '20 at 11:44
  • I successfully installed v1.12.0 on a Windows 10 PC running Python 3.9.1 using a command given above: python -m pip install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.12.0-py3-none-any.whl I had to use "python" because "python3" was not found – grjash Dec 12 '20 at 17:40
56

From tensorflow website: "You will need pip version 8.1 or later for the following commands to work". Run this command to upgrade your pip, then try install tensorflow again:

pip install --upgrade pip
Bang
  • 1,107
  • 11
  • 11
  • 13
    $ pip3 --version pip 9.0.1 from c:\work\apps\python\lib\site-packages (python 3.6) But still I see this error. – Sujoy Mar 01 '17 at 16:36
  • 8
    tensorflow does not work with python 3.6. You need version 3.5 – Jodo Mar 19 '17 at 21:13
  • 1
    Also, I had to use python -m pip install --upgrade pip. Otherwise I would get file permission issues... – Jodo Mar 19 '17 at 21:21
  • why not python 3.6 (latest version ),but python 3.5( lower version ) works It does'nt make any sense @Jodo – guru_007 Aug 05 '17 at 17:15
  • @guru_007 they stick to the version available on the latest Ubuntu LTS which is 3.5 at the moment (16.04) as far as I know. – Jodo Aug 05 '17 at 19:34
  • Never run the command `pip install --upgrade pip` on Windows - it uninstalled pip in preparation for installing the new version, and then had nothing to work with. Instead use `python -m pip install --upgrade pip`. I suggest editing the answer to include this. – matt_rule Aug 25 '18 at 09:34
43

If you are trying to install it on a windows machine you need to have a 64-bit version of python 3.5. This is the only way to actually install it. From the website:

TensorFlow supports only 64-bit Python 3.5 on Windows. We have tested the pip packages with the following distributions of Python:

Python 3.5 from Anaconda

Python 3.5 from python.org.

You can download the proper version of python from here (make sure you grab one of the ones that says "Windows x86-64")

You should now be able to install with pip install tensorflow or python -m pip install tensorflow (make sure that you are using the right pip, from python3, if you have both python2 and python3 installed)

Remember to install Anaconda 3-5.2.0 as the latest version which is 3-5.3.0 have python version 3.7 which is not supported by Tensorflow.

Community
  • 1
  • 1
Buzz
  • 1,877
  • 21
  • 25
43

I figured out that TensorFlow 1.12.0 only works with Python version 3.5.2. I had Python 3.7 but that didn't work. So, I had to downgrade Python and then I could install TensorFlow to make it work.

To downgrade your python version from 3.7 to 3.6

conda install python=3.6.8
Sujoy
  • 802
  • 11
  • 22
  • how to downgrade v3.6 to v3.5.2 ? – Essam Fahmi Sep 13 '17 at 01:38
  • Install 3.5.2 and update your classpath to point to 3.5.2. You can change back to 3.6 for other python stuff. – Sujoy Sep 13 '17 at 12:59
  • RuntimeWarning: compile time version 3.6 of module 'tensorflow.python.framework.fast_tensor_u til' does not match runtime version 3.7.... It is due to this error it is unable to fetch – Sumit Kumar Saha Jan 26 '19 at 10:42
  • At time of writing this comment, python 3.7 was compatible with tensorflow, but python 3.8 was not. – Charlie Jan 23 '20 at 03:52
  • 1
    You can (and should) also use multiple virtual environments for that purpose instead of downgrading like here: https://stackoverflow.com/a/45750900/4575793 – Cadoiz Jul 11 '20 at 22:19
21

Updated 11/28/2016: TensorFlow is now available in PyPI, starting with release 0.12. You can type

pip install tensorflow

...or...

pip install tensorflow-gpu

...to install the CPU-only or GPU-accelerated version of TensorFlow respectively.


Previous answer: TensorFlow is not yet in the PyPI repository, so you have to specify the URL to the appropriate "wheel file" for your operating system and Python version.

The full list of supported configurations is listed on the TensorFlow website, but for example, to install version 0.10 for Python 2.7 on Linux, using CPU only, you would type the following command:

$ pip install https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.10.0rc0-cp27-none-linux_x86_64.whl
mrry
  • 125,488
  • 26
  • 399
  • 400
  • will it work or will I need to setup other things also according to what https://www.tensorflow.org/versions/r0.10/get_started/os_setup.html says? –  Aug 12 '16 at 03:58
  • 5
    I still get the same error on OSX, is it working for everyone else? – lemonzi Jan 19 '17 at 16:55
  • @lemonzi, I also had an error in OSX, just posted a solution that worked for me (solution was to make sure I had Python 3.6 installed) – Julia Schwarz Jan 22 '17 at 18:35
  • @JuliaSchwarz This was not the issue; I'm using Python 2.7, and I also tried with a fresh install of Python 3.6. I ended up specifying the URL manually for the 1.0.0 alpha and it worked. – lemonzi Jan 24 '17 at 17:14
  • After trying every other solution, this worked for me. I'm using Python 2.7 on linux. – StatsSorceress Mar 27 '18 at 16:14
  • Could not find a version that satisfies the requirement tensorflow (from versions: ) No matching distribution found for tensorflow – Kardi Teknomo Dec 18 '18 at 08:19
  • @kardi see for example here: https://stackoverflow.com/a/41084963/4575793 – Cadoiz Jul 11 '20 at 22:20
  • @lemonzi Please consider my answer here about different combinations of python and tensorflow versions: https://stackoverflow.com/a/62855139/4575793 Only a handfull are compatible. – Cadoiz Jul 11 '20 at 22:23
  • (The previous is also @StatsSorceress ) Tensorflow CPU and GPU are now one thing since 2.0.0 - see https://github.com/fo40225/tensorflow-windows-wheel – Cadoiz Jul 11 '20 at 22:25
17

Install Python 3.5.x 64 bit amd version here. Make sure you add Python to your PATH variable. Then open a command prompt and type

python -m pip install --upgrade pip

should give you the following result :

 Collecting pip
 Using cached pip-9.0.1-py2.py3-none-any.whl
 Installing collected packages: pip
 Found existing installation: pip 7.1.2
 Uninstalling pip-7.1.2:
 Successfully uninstalled pip-7.1.2
 Successfully installed pip-9.0.1

Now type

 pip3 install --upgrade tensorflow
ascripter
  • 5,665
  • 12
  • 45
  • 68
11

I had the same problem and solved with this:

# Ubuntu/Linux 64-bit, CPU only, Python 2.7
(tensorflow)$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.12.1-cp27-none-linux_x86_64.whl

# Ubuntu/Linux 64-bit, GPU enabled, Python 2.7
# Requires CUDA toolkit 8.0 and CuDNN v5. For other versions, see "Installing from sources" below.

# Mac OS X, CPU only, Python 2.7:
(tensorflow)$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.12.1-py2-none-any.whl

# Mac OS X, GPU enabled, Python 2.7:
(tensorflow)$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/gpu/tensorflow_gpu-0.12.1-py2-none-any.whl

# Ubuntu/Linux 64-bit, CPU only, Python 3.4
(tensorflow)$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.12.1-cp34-cp34m-linux_x86_64.whl

# Ubuntu/Linux 64-bit, GPU enabled, Python 3.4
# Requires CUDA toolkit 8.0 and CuDNN v5. For other versions, see "Installing from sources" below.
(tensorflow)$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-0.12.1-cp34-cp34m-linux_x86_64.whl

# Ubuntu/Linux 64-bit, CPU only, Python 3.5
(tensorflow)$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.12.1-cp35-cp35m-linux_x86_64.whl

# Requires CUDA toolkit 8.0 and CuDNN v5. For other versions, see "Installing from sources" below.
(tensorflow)$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-0.12.1-cp35-cp35m-linux_x86_64.whl

# Mac OS X, CPU only, Python 3.4 or 3.5:
(tensorflow)$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.12.1-py3-none-any.whl

# Mac OS X, GPU enabled, Python 3.4 or 3.5:
(tensorflow)$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/gpu/tensorflow_gpu-0.12.1-py3-none-any.whl

Plus:

# Python 2
(tensorflow)$ pip install --upgrade $TF_BINARY_URL

# Python 3
(tensorflow)$ pip3 install --upgrade $TF_BINARY_URL

Found on Docs.

UPDATE!

There are new links for new versions

For example, for installing tensorflow v1.0.0 in OSX you need to use:

https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.0.0-py2-none-any.whl

instead of

https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.12.1-py2-none-any.whl
Andres
  • 4,323
  • 7
  • 39
  • 53
11

I had the same error when trying to install on my Mac (using Python 2.7). A similar solution to the one I'm giving here also seemed to work for Python 3 on Windows 8.1 according to a different answer on this page by Yash Kumar Verma

Solution

Step 1: go to The URL of the TensorFlow Python package section of the TensorFlow installation page and copy the URL of the relevant link for your Python installation.

Step 2: open a terminal/command prompt and run the following command:
pip install --upgrade [paste copied url link here]

So for me it was the following:
pip install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.2.0-py2-none-any.whl

Update (July 21 2017): I tried this with some others who were running on Windows machines with Python 3.6 and they had to change the line in Step 2 to: python -m pip install [paste copied url link here]

Update (26 July 2018): For Python 3.6.2 (not 3.7 because it's in 3.6.2 in TF Documentation), you can also use pip3 install --upgrade [paste copied URL here] in Step 2.

Infinite Loops
  • 671
  • 3
  • 11
  • 23
Jonny Brooks
  • 3,169
  • 3
  • 19
  • 22
  • 1
    This solution installs, but when I import tensorflow I get an error: – Tensigh Jul 04 '17 at 01:23
  • I've only used Keras with Tensorflow as a backend and it works fine. What error message do you get? – Jonny Brooks Jul 05 '17 at 07:21
  • Just tested and tensorflow imports fine for me. – Jonny Brooks Jul 06 '17 at 16:22
  • My problem was the version of Python I was using. I didn't know Python 3.5 was a requirement. Now it works. Thanks for the tip. – Tensigh Jul 06 '17 at 21:45
  • Great to hear that it worked in the end. If you had to do something different it would be worth you posting a separate answer. Otherwise, if you could give my answer an upvote that would be great. I struggled for a while to find a solution that worked so doing either one of the two will hopefully help others – Jonny Brooks Jul 07 '17 at 15:03
8

Try this:

export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.12.1-py3-none-any.whl
pip3 install --upgrade $TF_BINARY_URL

Source: https://www.tensorflow.org/get_started/os_setup (page no longer exists)

Update 2/23/17 Documentation moved to: https://www.tensorflow.org/install

David
  • 89
  • 1
  • 2
7
  1. Install python by checking Add Python to Path
  2. pip3 install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.12.0-py3-none-any.whl

This works for windows 10.0

Dinesh Karn
  • 81
  • 1
  • 3
7

Try this, it should work:

 python.exe -m pip install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.12.0-py3-none-any.whl
HISI
  • 4,557
  • 4
  • 35
  • 51
6

I had the same problem. After uninstalling the 32-bit version of python and reinstalling the 64-bit version I tried reinstalling TensorFlow and it worked.

Link to TensorFlow guide: https://www.tensorflow.org/install/install_windows

Stephen
  • 171
  • 3
  • 3
  • yes, the 64-bit version fixed it. The install from the main download page is a 32-bit. The link above provides a URL to the 64 bit version. – Vladan Mar 20 '18 at 18:23
6

If you run into this issue recently (say, after Python 3.7 release in 2018), most likely this is caused by the lack of Python 3.7 support (yet) from the tensorflow side. Try using Python 3.6 instead if you don't mind. There are some tricks you can find from https://github.com/tensorflow/tensorflow/issues/20444, but use them at your own risk. I used the one harpone suggested - first downloaded the tensorflow wheel for Python 3.6 and then renamed it manually...

cp tensorflow-1.11.0-cp36-cp36m-linux_x86_64.whl tensorflow-1.11.0-cp37-cp37m-linux_x86_64.whl
pip install tensorflow-1.11.0-cp37-cp37m-linux_x86_64.whl

The good news is that there is a pull request for 3.7 support already. Hope it will be released soon.

zinc
  • 139
  • 1
  • 3
6

There are multiple groups of answers to this question. This answer aims to generalize one group of answers:

There may not be a version of TensorFlow that is compatible with your version of Python. This is particularly true if you're using a new release of Python. For example, there may be a delay between the release of a new version of Python and the release of TensorFlow for that version of Python.

In this case, I believe your options are to:

  1. Upgrade or downgrade to a different version of Python. (Virtual environments are good for this, e.g. conda install python=3.6)
  2. Select a specific version of tensorflow that is compatible with your version of python, e.g. if you're still using python3.4: pip install tensorflow==2.0
  3. Compile TensorFlow from the source code.
  4. Wait for a new release of TensorFlow which is compatible with your version of Python.
craq
  • 1,441
  • 2
  • 20
  • 39
Eric McLachlan
  • 3,132
  • 2
  • 25
  • 37
  • 2
    This page will show you which versions of tensorflow are compatible with which versions of python and CUDA: https://www.tensorflow.org/install/source#gpu – craq Jan 11 '21 at 22:20
6

as of today, if anyone else is wondering, python >= 3.9 will cause the same issue uninstall python 3.9, and install 3.8 , it should resolve it

Ahmed
  • 71
  • 1
  • 3
  • You don't have to uninstall python. You can have multiple versions! Just invoke the correct pip with `python3.8 -m pip install tensorflow` – paulgavrikov Feb 07 '21 at 22:56
  • True. but for someone doing generic python, only using it occasionally , without a clear need to a specific version, I would prefer having a single version. just an opinion :) – Ahmed Feb 09 '21 at 01:25
5

If you are using the Anaconda Python installation, pip install tensorflow will give the error stated above, shown below:

Collecting tensorflow
Could not find a version that satisfies the requirement tensorflow (from versions: )
No matching distribution found for tensorflow

According to the TensorFlow installation page, you will need to use the --ignore-installed flag when running pip install.

However, before this can be done see this link to ensure the TF_BINARY_URL variable is set correctly in relation to the desired version of TensorFlow that you wish to install.

tallamjr
  • 1,272
  • 1
  • 16
  • 21
5

For pyCharm users:

  1. Check pip version: pip3 -V
  2. If pip is older than 9.0.1: py -3 -m pip install --upgrade pip
  3. Then: py -3 -m pip install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.12.0-py3-none-any.whl
Cadoiz
  • 1,446
  • 21
  • 31
Alex Gore
  • 332
  • 1
  • 3
  • 9
  • Be aware, that the given link is just for one single legacy version. For the different possible versions of python and tensorflow, you can refer to my answer here: https://stackoverflow.com/a/62855139/4575793 A huge list of different wheels/compatibilities can be found here: https://github.com/fo40225/tensorflow-windows-wheel – Cadoiz Jul 12 '20 at 00:59
5

If you're trying to install tensorflow in anaconda and it isn't working, then you may need to downgrade python version because only 3.6.x is currently supported while anaconda has the latest version.

  1. check python version: python --version

  2. if version > 3.6.x then follow step 3, otherwise stop, the problem may be somewhere else

  3. conda search python

  4. conda install python=3.6.6

  5. Check version again: python --version

  6. If version is correct, install tensorflow (step 7)

  7. pip install tensorflow

ACV
  • 9,964
  • 5
  • 76
  • 81
4

Unfortunately my reputation is to low to command underneath @Sujoy answer.

In their docs they claim to support python 3.6. The link provided by @mayur shows that their is indeed only a python3.5 wheel package. This is my try to install tensorflow:

Microsoft Windows [Version 10.0.16299.371]
(c) 2017 Microsoft Corporation. All rights reserved.

C:\>python3 -m pip install --upgrade pip
Requirement already up-to-date: pip in d:\python\v3\lib\site-packages (10.0.0)

C:\>python3 -m pip -V
pip 10.0.0 from D:\Python\V3\lib\site-packages\pip (python 3.6)

C:\>python3 -m pip install --upgrade tensorflow
Collecting tensorflow
Could not find a version that satisfies the requirement tensorflow (from versions: )
No matching distribution found for tensorflow

while python 3.5 seems to install successfully. I would love to see a python3.6 version since they claim it should also work on python3.6.

Quoted :

"TensorFlow supports Python 3.5.x and 3.6.x on Windows. Note that Python 3 comes with the pip3 package manager, which is the program you'll use to install TensorFlow."

Source : https://www.tensorflow.org/install/install_windows

Python3.5 install :

Microsoft Windows [Version 10.0.16299.371]
(c) 2017 Microsoft Corporation. All rights reserved.

C:\>python3 -m pip install --upgrade pip
Requirement already up-to-date: pip in d:\python\v3\lib\site-packages (10.0.0)

C:\>python3 -m pip -V
pip 10.0.0 from D:\Python\V3_5\lib\site-packages\pip (python 3.5.2)

C:\>python3 -m pip install --upgrade tensorflow
Collecting tensorflow
  Downloading 
    ....
    ....

I hope i am terrible wrong here but if not ring a alarm bell

Edit: A couple of posts below someone pointed out that the following command would work and it did.

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

Strange pip is not working

YetAnotherDuck
  • 294
  • 4
  • 13
4

Following these steps allows you to install tensorflow and keras:

  1. Download Anaconda3-5.2.0 which comes with python 3.6 from https://repo.anaconda.com/archive/

  2. Install Anaconda and open Anaconda Prompt and execute below commands

    conda install jupyter 
    conda install scipy
    pip install sklearn
    pip install msgpack
    pip install pandas
    pip install pandas-datareader
    pip install matplotlib 
    pip install pillow
    pip install requests
    pip install h5py
    pip install tensorflow
    pip install keras
    
Christopher Moore
  • 15,626
  • 10
  • 42
  • 52
Vaibhav Sharma
  • 1,573
  • 2
  • 19
  • 35
4

Tensorflow DOES NOT support python versions after 3.8 as of when I'm writing this at least (December 2020). Use this: https://www.tensorflow.org/install to check what python versions it supports, I just spent hours looking through these answers, took me way too long to realise that.

Mof
  • 81
  • 5
4

I was able to install tensorflow-macos and tensrflow-metal on my Mac

$ python -m pip install -U pip
$ pip install tensorflow-macos
$ pip install tensorflow-metal
PSN
  • 2,326
  • 3
  • 27
  • 52
3

This worked for me with Python 2.7 on Mac OS X Yosemite 10.10.5:

sudo pip install --upgrade https://storage.googleapis.com/tensorflow/mac/tensorflow-0.5.0-py2-none-any.whl
Floern
  • 33,559
  • 24
  • 104
  • 119
Amit
  • 438
  • 5
  • 5
3
  1. Start Command Prompt with Administrative Permission
  2. Enter following command python -m pip install --upgrade pip
  3. Next Enter command pip install tensorflow
Croko
  • 99
  • 1
  • 4
3

update 2019: for install the preview version of TensorFlow 2 in Google Colab you can use:

!wget https://developer.nvidia.com/compute/cuda/10.0/Prod/local_installers/cuda-repo-ubuntu1604-10-0-local-10.0.130-410.48_1.0-1_amd64 -O cuda-repo-ubuntu1604-10-0-local-10.0.130-410.48_1.0-1_amd64.deb
!dpkg -i cuda-repo-ubuntu1604-10-0-local-10.0.130-410.48_1.0-1_amd64.deb
!apt-key add /var/cuda-repo-10-0-local-10.0.130-410.48/7fa2af80.pub
!apt-get update
!apt-get install cuda
!pip install tf-nightly-gpu-2.0-preview

and for install the TensorFlow 2 bye pip you can use: pip install tf-nightly-gpu-2.0-preview for GPU and pip install tf-nightly-2.0-preview for CPU.

Cadoiz
  • 1,446
  • 21
  • 31
3

I installed tensorflow on conda but didnt seem to work on windows but finally this command here works fine on cmd.

 python.exe -m pip install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.12.0-py3-none-any.whl
sauravjoshi23
  • 837
  • 11
  • 9
  • ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. tensorboard 2.12.3 requires protobuf>=3.19.6, but you have protobuf 3.1.0 which is incompatible. – Yanov Jun 20 '23 at 08:44
3

if you tried the solutions above and didin't solve the problem, it can be because of version inconsistency.

I installed python 3.9 and i couldn't install tensorflow with pip.

And then I uninstalled 3.9, then installed 3.8.7 and success... the max version that tensorflow is supported by is 3.8.x (in 2021) so, check your python version is compatible or not with current tensorflow.

barismanco
  • 43
  • 3
2

I was facing the same issue. I tried the following and it worked. installing for Mac OS X, anaconda python 2.7

pip uninstall tensorflow export TF_BINARY_URL=<get the correct url from http://tflearn.org/installation/> pip install --upgrade $TF_BINARY_URL

Installed tensorflow-1.0.0

kavini
  • 143
  • 2
  • 8
2

The URL to install TensorFlow in Windows, below is the URL. It worked fine for me.

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

Nothing here worked for me on Windows 10. Perhaps an updated solution below that did work for me.

python -m pip install --upgrade tensorflow.

This is using Python 3.6 and tensorflow 1.5 on Windows 10

Tim Hallman
  • 854
  • 15
  • 27
2

Here is my Environment (Windows 10 with NVIDIA GPU). I wanted to install TensorFlow 1.12-gpu and failed multiple times but was able to solve by following the below approach.

This is to help Installing TensorFlow-GPU on Windows 10 Systems

Steps:

  1. Make sure you have NVIDIA graphic card

a. Go to windows explorer, open device manager-->check “Display Adaptors”-->it will show (ex. NVIDIA GeForce) if you have GPU else it will show “HD Graphics”

b. If the GPU is AMD’s then tensorflow doesn’t support AMD’s GPU

  1. If you have a GPU, check whether the GPU supports CUDA features or not.

a. If you find your GPU model at this link, then it supports CUDA.

b. If you don’t have CUDA enabled GPU, then you can install only tensorflow (without gpu)

  1. Tensorflow requires python-64bit version. Uninstall any python dependencies

a. Go to control panel-->search for “Programs and Features”, and search “python”

b. Uninstall things like anaconda and any pythons related plugins. These dependencies might interfere with the tensorflow-GPU installation.

c. Make sure python is uninstalled. Open a command prompt and type “python”, if it throws an error, then your system has no python and your can proceed to freshly install python

  1. Install python freshly

a.TF1.12 supports upto Python 3.6.6. Click here to download Windows x86-64 executable installer

b. While installing, select “Add Python 3.6 to PATH” and then click “Install Now”.

enter image description here

c. After successful installation of python, the installation window provides an option for disabling path length limit which is one of the root-cause of Tensorflow build/Installation issues in Windows 10 environment. Click “Disable path length limit” and follow the instructions to complete the installation.

enter image description here

d. Verify whether python installed correctly. Open a command prompt and type “python”. It should show the version of Python.

enter image description here

  1. Install Visual Studio

Visual Studio 2017 Community

a. Click the "Visual Studio Link" above.Download Visual Studio 2017 Community.

b. Under “Visual Studio IDE” on the left, select “community 2017” and download it

c. During installation, Select “Desktop development with C++” and install

  1. CUDA 9.0 toolkit

https://developer.nvidia.com/cuda-90-download-archive?target_os=Windows&target_arch=x86_64&target_version=10&target_type=exelocal

a. Click "Link to CUDA 9.0 toolkit" above, download “Base Installer”

b. Install CUDA 9.0

  1. Install cuDNN

https://developer.nvidia.com/cudnn

a. Click "Link to Install cuDNN" and select “I Agree To the Terms of the cuDNN Software License Agreement”

b. Register for login, check your email to verify email address

c. Click “cuDNN Download” and fill a short survey to reach “cuDNN Download” page

d. Select “ I Agree To the Terms of the cuDNN Software License Agreement”

e. Select “Download cuDNN v7.5.0 (Feb 21, 2019), for CUDA 9.0"

f. In the dropdown, click “cuDNN Library for Windows 10” and download

g. Go to the folder where the file was downloaded, extract the files

enter image description here

h. Add three folders (bin, include, lib) inside the extracted file to environment

enter image description here

i. Type “environment” in windows 10 search bar and locate the “Environment Variables” and click “Path” in “User variable” section and click “Edit” and then select “New” and add those three paths to three “cuda” folders

j. Close the “Environmental Variables” window.

  1. Install tensorflow-gpu

a. Open a command prompt and type “pip install --upgrade tensorflow-gpu”

b. It will install tensorflow-gpu

  1. Check whether it was correctly installed or not

a. Type “python” at the command prompt

b. Type “import tensorflow as tf

c. hello=tf.constant(‘Hello World!’)

d. sess=tf.Session()

e. print(sess.run(hello)) -->Hello World!

  1. Test whether tensorflow is using GPU

a. from tensorflow.python.client import device_lib print(device_lib.list_local_devices())

b. print(device_lib.list_local_devices())

Vishnuvardhan Janapati
  • 3,088
  • 1
  • 16
  • 25
  • 1
    Don't use `--ignore-installed`. https://stackoverflow.com/questions/53807511/pip-cannot-uninstall-package-it-is-a-distutils-installed-project/53807588#53807588 – ivan_pozdeev May 08 '19 at 02:28
  • @ivan_pozdeev removed the `--ignore-installed`. For me using `--ignore-installed` didn't throw an error, but I don't need to use it. Thanks! – Vishnuvardhan Janapati May 08 '19 at 12:03
2

Python 3.7 works for me, I uninstalled python 3.8.1 and reinstalled 3.7.6. After that, I executed:

pip3 install --user --upgrade tensorflow

and it works

johannchopin
  • 13,720
  • 10
  • 55
  • 101
Mingming Qiu
  • 333
  • 4
  • 9
  • This answer is simpel and spot on. You need to check which python version is supported by the version TensorFlow you want to install. Then install this version of python. For TensorFlow 1.15, python 3.7 x64 workes. – Stefan Dec 28 '20 at 11:51
2

I understand that the issue is pretty old but recently I faced it on MacBook Air M1. The solution was just to use this command pip install tensorflow-macos.

chm
  • 359
  • 2
  • 11
1

I had this problem on OSX Sierra 10.12.2. It turns out I had the wrong version of Python installed (I had Python 3.4 but tensorflow pypi packages for OSX are only for python 3.5 and up).

The solution was to install Python 3.6. Here's what I did to get it working. Note: I used Homebrew to install Python 3.6, you could do the same by using the Python 3.6 installer on python.org

brew uninstall python3
brew install python3
python3 --version # Verify that you see "Python 3.6.0"
pip install tensorflow # With python 3.6 the install succeeds
pip install jupyter # "ipython notebook" didn't work for me until I installed jupyter
ipython notebook # Finally works!
Julia Schwarz
  • 2,610
  • 1
  • 19
  • 25
1

For windows this worked for me,

Download the wheel from this link. Then from command line navigate to your download folder where the wheel is present and simply type in the following command -

pip install tensorflow-1.0.0-cp36-cp36m-win_amd64.whl

Ic3fr0g
  • 1,199
  • 15
  • 26
1

Excerpt from tensorflow website https://www.tensorflow.org/install/install_windows

Installing with native pip

If the following version of Python is not installed on your machine, install it now:

Python 3.5.x from python.org TensorFlow only supports version 3.5.x of Python on Windows. Note that Python 3.5.x comes with the pip3 package manager, which is the program you'll use to install TensorFlow.

To install TensorFlow, start a terminal. Then issue the appropriate pip3 install command in that terminal. To install the CPU-only version of TensorFlow, enter the following command:

C:\> pip3 install --upgrade tensorflow
To install the GPU version of TensorFlow, enter the following command:

C:\> pip3 install --upgrade tensorflow-gpu
Community
  • 1
  • 1
Ravinder Payal
  • 2,884
  • 31
  • 40
1

If your command pip install --upgrade tensorflowcompiles, then your version of tensorflow should be the newest. I personally prefer to use anaconda. You can easily install and upgrade tensorflow as follows:

 conda install -c conda-forge tensorflow  # to install
 conda upgrade -c conda-forge tensorflow  # to upgrade

Also if you want to use it with your GPU you have an easy install:

 conda install -c anaconda tensorflow-gpu

I've been using it for a while now and I have never had any problem.

silgon
  • 6,890
  • 7
  • 46
  • 67
1

Currently PIP does not have a 32bit version of tensorflow, it worked when I uninstalled python 32bit and installed x64

FabioStein
  • 750
  • 7
  • 23
1

Note: This answer is for Cygwin users

Leaving this answer because none of the others here worked for my use case (using the *nix-on-Windows terminal environment to install tensorflow on a virtualenv, cygwin (http://www.cygwin.com/)) (at least a simple control+F on the answer pages found nothing).

TLDR: If you are using a virtualenv in a cygwin terminal, know that cygwin seems to have a problem installing tensorflow and throws the error specified in this post's question (a similar sentiment can be found here (https://stackoverflow.com/a/45230106/8236733) (similar cause, different error)). Solved by creating the virtualenv in the Windows Command Prompt. Then can access / activate the virtualenv from a cygwin terminal via source ./Scripts/activate to use Windows' (not cygwin's) python.


When just using cygwin's python3 to try use tensorflow, eg. something like...

apt-cyg install python3-devel
cd python-virtualenv-base
virtualenv -p `which python3` tensorflow-examples

found that there were some problems with installing tensorflow-gpu package using cygwin's python. Was seeing the error

$ pip install tensorflow --user
Collecting tensorflow
Could not find a version that satisfies the requirement tensorflow (from versions: )
No matching distribution found for tensorflow

There are many proposed solutions, none of them helped in my case (they are all generally along the lines of "You probably have python3 for 32-bit achitectures installed, tensorflow requires 64-bit" or some other python mismatch mistake (whereas here, it's simply seems to be that cygwin's python had problems installing tensorflow-gpu)).

What did end up working for me was doing...

  1. Install python3 via the official Windows way for the Windows system (the cygwin system is separate, so uses a different python)
  2. Open the Command Prompt in Windows (not a cygwin terminal) and do...
C:\Users\me\python-virtualenvs-base>python
Python 3.6.2 (v3.6.2:5fd33b5, Jul  8 2017, 04:57:36) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()

C:\Users\me\python-virtualenvs-base>pip -V
pip 9.0.1 from c:\users\me\appdata\local\programs\python\python36\lib\site-packages (python 3.6)

C:\Users\me\python-virtualenvs-base>pip install virtualenv
Collecting virtualenv
  Downloading https://files.pythonhosted.org/packages/b6/30/96a02b2287098b23b875bc8c2f58071c35d2efe84f747b64d523721dc2b5/virtualenv-16.0.0-py2.py3-none-any.whl (1.9MB)
    100% |████████████████████████████████| 1.9MB 435kB/s
Installing collected packages: virtualenv
Successfully installed virtualenv-16.0.0
You are using pip version 9.0.1, however version 18.0 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

C:\Users\me\python-virtualenvs-base>virtualenv tensorflow-examples
Using base prefix 'c:\\users\\me\\appdata\\local\\programs\\python\\python36'
New python executable in C:\Users\me\python-virtualenvs-base\tensorflow-examples\Scripts\python.exe
Installing setuptools, pip, wheel...done.
  1. Then, can go back to the cygwin terminal, navigate back to that virtualenv that you created in the command prompt and do...
    ➜  tensorflow-examples source ./Scripts/activate
    (tensorflow-examples) ➜  tensorflow-examples python -V
    Python 3.6.2
    (tensorflow-examples) ➜  tensorflow-examples pip install tensorflow-gpu
    Collecting tensorflow-gpu
      Downloading 
      ....

Notice you don't do source ./bin/activate in the virtualenv as you would if you had created the virtualenv in cygwin's pseudo-linux environment, but instead do source ./Scripts/activate.

lampShadesDrifter
  • 3,925
  • 8
  • 40
  • 102
1

My env: Win 10, python 3.6

pip3 install --upgrade tensorflow
pip install --upgrade tensorflow

With error:

> Collecting tensorflow Could not find a version that satisfies the
> requirement tensorflow (from versions: ) No matching distribution
> found for tensorflow

I also tried pip install tensorflow and pip install tensorflow-gpu. But error:

> Could not find a version that satisfies the requirement tensorflow (from versions: ) No matching distribution found for tensorflow
> Could not find a version that satisfies the requirement tensorflow-gpu (from versions: ) No matching distribution found for tensorflow-gpu

Install OK when tried with Step: (https://www.tensorflow.org/install/install_windows)

  1. Follow the instructions on the Anaconda download site to download and install Anaconda. https://www.continuum.io/downloads

  2. Create a conda environment named tensorflow by invoking the following command:

    C:> conda create -n tensorflow pip python=3.5 
    
  3. Activate the conda environment by issuing the following command:

    C:> activate tensorflow
     (tensorflow)C:>  # Your prompt should change 
    
  4. Issue the appropriate command to install TensorFlow inside your conda environment. To install the CPU-only version of TensorFlow, enter the following command:

    (tensorflow)C:> pip install --ignore-installed --upgrade tensorflow 
    

    To install the GPU version of TensorFlow, enter the following command (on a single line):

    (tensorflow)C:> pip install --ignore-installed --upgrade tensorflow-gpu 
    
Tính Ngô Quang
  • 4,400
  • 1
  • 33
  • 33
1

If you are trying to install Tensorflow with Anaconda on Windows, a free advice is to please uninstall anaconda and download a 64-bit Python version, ending with amd64 from releases page. For me, its python-3.7.8-amd64.exe

Then install Tensorflow in a virtual environment by following the instructions on official website of Tensorflow.

DevLoverUmar
  • 11,809
  • 11
  • 68
  • 98
1

I had the same issue and the problem was the AWS machine I was using had an ARM processor!

I had to manually build tensorflow

Ariel Lubonja
  • 83
  • 1
  • 10
0

The correct way to install it would be as mentioned here

$ pip install --upgrade TF_BINARY_URL   # Python 2.7
$ pip3 install --upgrade TF_BINARY_URL  # Python 3.N

Find the correct TF_BINARY_URL for your hardware from the tensor flow official homepage

Rahul Thakur
  • 824
  • 1
  • 12
  • 27
0

The only thing that worked for me was to use Ananconda and create a new conda env with conda create -n tensorflow python=3.5 then activate using activate tensorflow and finally conda install -c conda-forge tensorflow.

This works around every issue I had including ssl certs, proxy settings, and does not need admin access. It should be noted that this is not directly supported by the tensorflow team.

Source

bendl
  • 1,583
  • 1
  • 18
  • 41
0

Here is what I did for Windows 10! I also did not disturb my previous installation of Python 2.7

Step1: Install Windows x86-64 executable installer from the link: https://www.python.org/downloads/release/python-352/

Step2: Open cmd as Administrator enter image description here

Step3: Type this command:

pip install https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-0.12.0rc0-cp35-cp35m-win_amd64.whl

You should see that it works and as shown in the picture below, I also tried the sample example. enter image description here

Adam Merckx
  • 1,122
  • 1
  • 14
  • 31
0

I've found out the problem.

I'm using a Windows computer which has Python 2 installed previously. After Python 3 is installed (without setting the path, I successfully check the version of pip3 - but the python executable file still points to the Python2)

Then I set the path to the python3 executable file (remove all python2 paths) then start a new command prompt, try to reinstall Tensorflow. It works!

I think this problem could happend on MAC OS too since there is a default python which is on the MAC system.

0

Check https://pypi.python.org/pypi/tensorflow to see which packages are available.

As of this writing, they don't provide a source package, so if there's no prebuilt one for your platform, this error occurs. If you add -v to the pip command line, you'll see it iterating over the packages that are available at PyPI and discarding them for being incompatible.

You need to either find a prebuilt package somewhere else, or compile tensorflow yourself from its sources by instructions at https://www.tensorflow.org/install/install_sources .

They have a good reason for not building for some platforms though:

ivan_pozdeev
  • 33,874
  • 19
  • 107
  • 152
0

It seems there could be multiple reasons for tensorFlow not getting installed via pip. The one I faced on windows 10 was that I didn't had supported version of cudnn in my system path. As of now [Dec 2017], tensorflow on windows only supports cudnn v6.1. So, provide the path of cudnn 6.1, if everything else is correct then tensorflow should be installed.

Adarsh
  • 433
  • 6
  • 14
0

I have experienced the same error while I tried to install tensorflow in an anaconda package. After struggling a lot, I finally found an easy way to install any package without running into an error. First create an environment in your anaconda administrator using this command

conda create -n packages

Now activate that environment

activate packages 

and try running

pip install tensorflow 

After a successful installation, we need to make this environment accessible to jupyter notebook. For that, you need to install a package called ipykernel using this command

pip install ipykernel

After installing ipykernel enter the following command

python -m ipykernel install --user --name=packages

After running this command, this environment will be added to jupyter notebook and that's it. Just go to your jupyter notebook, click on new notebook, and you can see your environment. Select that environment and try importing tensorflow and in case if you want to install any other packages, just activate the environment and install those packages and use that environment in your jupyter

Mr. T
  • 11,960
  • 10
  • 32
  • 54
0

I was having this problem too. When looking at the different .whl files. I noticed there was no 32-bit version of tensorflow on python 3.7. In the end just had to install 64bit Python 3.7 from here.

isXander
  • 127
  • 1
  • 7
0

2.0 COMPATIBLE SOLUTION:

Execute the below commands in Terminal (Linux/MacOS) or in Command Prompt (Windows) to install Tensorflow 2.0 using Pip:

#Install tensorflow using pip virtual env 
pip install virtualenv
virtualenv tf_2.0.0   # tf_2.0.0 is virtual env name
source tf_2.0.0/bin/activate
#You should see tf_2.0.0 Env now. Execute the below steps
pip install tensorflow==2.0.0
python
>>import tensorflow as tf
>>tf.__version__
2.0.0

Execute the below commands in Terminal (Linux/MacOS) or in Command Prompt (Windows) to install Tensorflow 2.0 using Bazel:

git clone https://github.com/tensorflow/tensorflow.git
cd tensorflow

#The repo defaults to the master development branch. You can also checkout a release branch to build:
git checkout r2.0

#Configure the Build => Use the Below line for Windows Machine
python ./configure.py 

#Configure the Build => Use the Below line for Linux/MacOS Machine
./configure
#This script prompts you for the location of TensorFlow dependencies and asks for additional build configuration options. 

#Build Tensorflow package

#CPU support
bazel build --config=opt //tensorflow/tools/pip_package:build_pip_package 

#GPU support
bazel build --config=opt --config=cuda --define=no_tensorflow_py_deps=true //tensorflow/tools/pip_package:build_pip_package
0

For Window you can use below command

python3 -m pip install --upgrade https://storage.googleapis.com/tensorflow/windows/gpu/tensorflow_gpu-2.3.0-cp38-cp38-win_amd64.whl
Bhushan Khaladkar
  • 420
  • 1
  • 7
  • 20
0

Had similar problem

Turned out the default is GPU version, and I've installed it on a server with no GPU.

pip install --upgrade tensorflow-cpu

Did the trick

Ohad Cohen
  • 5,756
  • 3
  • 39
  • 36
0

It is easier using Git, they are provided the methods on the websites but the link access may not be significant you may read from

https://www.tensorflow.org/install/source_windows

git clone https://github.com/tensorflow/tensorflow.git

My Python is 3.9.7. I also use Windows 10 with the requirements as below:

1. Microsoft C++ Retribution installed from Microsoft Visual Studio that matches with x64bits as required in the list.

1.1 Microsoft Visual C++ 2012 Redistribution ( x64 ) and updates    
1.2 Microsoft Visual C++ 2013 Redistributable (x64) - 12.0.40664
1.3 Microsoft Visual C++ 2015-2019 Redistributable (x64) - 14.29.30133
1.4 vs_community__1795732196.1624941787.exe updates

2. Python and AI learning 
tensorboard                2.6.0
tensorboard-data-server    0.6.1
tensorboard-plugin-profile 2.5.0
tensorboard-plugin-wit     1.8.0
***tensorflow                 2.6.0
tensorflow-datasets        4.4.0
tensorflow-estimator       2.6.0
***tensorflow-gpu             2.6.0
tensorflow-hub             0.12.0
tensorflow-metadata        1.2.0
tensorflow-text            2.6.0
***PyOpenGL                   3.1.5
pyparsing                  2.4.7
python-dateutil            2.8.2
python-slugify             5.0.2
python-speech-features     0.6
PyWavelets                 1.1.1
PyYAML                     5.4.1
scikit-image               0.18.3
scikit-learn               1.0.1
***gym                        0.21.0
General Grievance
  • 4,555
  • 31
  • 31
  • 45
  • For CuDNN, I just installed toolkits and environment included C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.4\bin ( My graphic driver is old ) – Jirayu Kaewprateep Jan 18 '22 at 08:52
0

Something that will tell you specifically what the issue is is to do:

pip install -vvv tensorflow

This will show you the wheel files that are available and why they are not matched.

If you do then pip debug --verbose it will show you all the tags that are compatible.

In my case I was trying to install tensorflow on an m1 mac in a multipass ubuntu instance, and needed https://pypi.org/project/tensorflow-aarch64/ instead

Jon Vaughan
  • 2,058
  • 1
  • 18
  • 11
0

In order to solve this error you may need upgrade pip first, and then install TensorFlow as below

# Requires the latest pip
pip install --upgrade pip

# Current stable release for CPU and GPU
pip install tensorflow

If you using anaconda prompt, then try this

conda install -c anaconda tensorflow-gpu
0

If you’re using Apple Silicon Mac, then you need to install the tensorflow-macos package with pip:

pip3 install tensorflow-macos 
# Optional if you want to use Metal API:
pip3 install tensorflow-metal
jms
  • 17
  • 1
  • 4
-1

You may try this

pip install --upgrade tensorflow
Nurdin
  • 23,382
  • 43
  • 130
  • 308
-1

The above answers helped me to solve my issue specially the first answer. But adding to that point after the checking the version of python and we need it to be 64 bit version.

Based on the operating system you have we can use the following command to install tensorflow using pip command.

The following link has google api links which can be added at the end of the following command to install tensorflow in your respective machine.

Root command: python -m pip install --upgrade (link) link : respective OS link present in this link

Community
  • 1
  • 1
HEART94
  • 307
  • 2
  • 10