I'm trying to install TensorFlow using pip:
$ pip install tensorflow --userCollecting tensorflowCould not find a version that satisfies the requirement tensorflow (from versions: )No matching distribution found for tensorflowWhat am I doing wrong? So far I've used Python and pip with no issues.
- 19try this:
pip install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.0.1-py2-none-any.whllkahtz– lkahtz2017-03-24 13:02:46 +00:00CommentedMar 24, 2017 at 13:02 - 3The 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.Ncode`Rahul Thakur– Rahul Thakur2017-04-07 05:03:47 +00:00CommentedApr 7, 2017 at 5:03 - 48For me this happens with python 3.7, After hours of struggle I used 3.6 and that worked.clankill3r– clankill3r2018-09-07 22:59:21 +00:00CommentedSep 7, 2018 at 22:59
- 5Use Anaconda for tensorflow installationsaket– saket2018-09-16 18:53:10 +00:00CommentedSep 16, 2018 at 18:53
- 7Currently facing the same problem in Python3.9 . In python3.8 , it works fineJdeep– Jdeep2020-10-26 10:11:05 +00:00CommentedOct 26, 2020 at 10:11
61 Answers61
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.whlEdit 1: This was tested on Windows (8, 8.1, 10), Mac and Linux. Changepython3 topython according to your configuration. Changepy3 topy2 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
15 Comments
tensorflow only supports python 64-bit. You might be using 32-bit installation. Install 64-bit python and it works withpip install tensorflow directly. Refer to the correct answers below before trying this approach.You need a 64-bit version of Python and in your case are using a 32-bit version. As of now Tensorflow only supports64-bit versions of Python 3.5.x and 3.8.x on Windows. See theinstall docs to see what is currently supported
To check which version of Python you are running, typepython orpython3 to start the interpreter, and then typeimport struct;print(struct.calcsize("P") * 8) and that will print either32 or64 to tell you which bit version of Python you are running.
From comments:
To download a different version of Python for Windows, go topython.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
13 Comments
python orpython3 to start the interpreter, and then typeimport struct;print(struct.calcsize("P") * 8) and that will print either 32 or 64 to tell you which type you are running.You need to use the right version of Python andpip.
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 isonly 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 toPATH environment.
C:\Users\AppData\Local\Programs\Python\Python36C:\Users\AppData\Local\Programs\Python\Python36\ScriptsThen rungpupdate /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>pythonPython 3.6.3 (v3.6.3:2c5fed8, Oct 3 2017, 18:11:49) [MSC v.1900 64 bit (AMD64)] on win32Type "help", "copyright", "credits" or "license" for more information.Then run below command to install tensorflow CPU version (recommended)
pip3 install --upgrade tensorflowOctober 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.
6 Comments
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 pip6 Comments
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.85 Comments
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 thewebsite:
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 fromhere (make sure you grab one of the ones that says "Windows x86-64")
You should now be able to install withpip install tensorflow orpython -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.
Comments
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 thePyPI 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 theTensorFlow 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.whl9 Comments
Install Python 3.5.x 64 bit amd versionhere. Make sure you add Python to your PATH variable. Then open a command prompt and type
python -m pip install --upgrade pipshould 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.1Now type
pip3 install --upgrade tensorflow1 Comment
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.whlPlus:
# Python 2(tensorflow)$ pip install --upgrade $TF_BINARY_URL# Python 3(tensorflow)$ pip3 install --upgrade $TF_BINARY_URLFound onDocs.
UPDATE!
There arenew links for new versions
For example, for installingtensorflow v1.0.0 in OSX you need to use:
https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.0.0-py2-none-any.whlinstead of
https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.12.1-py2-none-any.whl1 Comment
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 byYash Kumar Verma
Solution
Step 1: go toThe 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 inStep 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 usepip3 install --upgrade [paste copied URL here] inStep 2.
5 Comments
Try this:
export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.12.1-py3-none-any.whlpip3 install --upgrade $TF_BINARY_URLSource:https://www.tensorflow.org/get_started/os_setup (page no longer exists)
Update 2/23/17Documentation moved to:https://www.tensorflow.org/install
Comments
- Install python by checking Add Python to Path
- pip3 install --upgradehttps://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.12.0-py3-none-any.whl
This works for windows 10.0
Comments
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.whlComments
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
1 Comment
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 fromhttps://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.whlpip install tensorflow-1.11.0-cp37-cp37m-linux_x86_64.whlThe good news is that there is a pull request for 3.7 support already. Hope it will be released soon.
Comments
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:
- Upgrade or downgrade to a different version of Python. (Virtual environments are good for this, e.g.
conda install python=3.6) - 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 - Compile TensorFlow from the source code.
- Wait for a new release of TensorFlow which is compatible with your version of Python.
1 Comment
as of today, if anyone else is wondering,python >= 3.9 will cause the same issueuninstall python 3.9, and install 3.8 , it should resolve it
2 Comments
python3.8 -m pip install tensorflowIf you are using the Anaconda Python installation,pip install tensorflow will give the error stated above, shown below:
Collecting tensorflowCould not find a version that satisfies the requirement tensorflow (from versions: )No matching distribution found for tensorflowAccording 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 thislinkto ensure the TF_BINARY_URL variable is set correctly in relation to the desired version of TensorFlow that you wish to install.
Comments
If you're trying to install tensorflow in anaconda and it isn't working, then you may need to downgrade python version because only3.6.x is currently supported while anaconda has the latest version.
check python version:
python --versionif version >
3.6.xthen follow step 3, otherwise stop, the problem may be somewhere elseconda search pythonconda install python=3.6.6Check version again:
python --versionIf version is correct, install tensorflow (step 7)
pip install tensorflow
Comments
For pyCharm users:
- Check pip version:
pip3 -V - If pip is older than 9.0.1:
py -3 -m pip install --upgrade pip - Then:
py -3 -m pip install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.12.0-py3-none-any.whl
1 Comment
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 pipRequirement already up-to-date: pip in d:\python\v3\lib\site-packages (10.0.0)C:\>python3 -m pip -Vpip 10.0.0 from D:\Python\V3\lib\site-packages\pip (python 3.6)C:\>python3 -m pip install --upgrade tensorflowCollecting tensorflowCould not find a version that satisfies the requirement tensorflow (from versions: )No matching distribution found for tensorflowwhile 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 pipRequirement already up-to-date: pip in d:\python\v3\lib\site-packages (10.0.0)C:\>python3 -m pip -Vpip 10.0.0 from D:\Python\V3_5\lib\site-packages\pip (python 3.5.2)C:\>python3 -m pip install --upgrade tensorflowCollecting 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.whlStrange pip is not working 🤔
Comments
Following these steps allows you to install tensorflow and keras:
Download Anaconda3-5.2.0 which comes with python 3.6 fromhttps://repo.anaconda.com/archive/
Install Anaconda and open Anaconda Prompt and execute below commands
conda install jupyter conda install scipypip install sklearnpip install msgpackpip install pandaspip install pandas-datareaderpip install matplotlib pip install pillowpip install requestspip install h5pypip install tensorflowpip install keras
1 Comment
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.
Comments
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-metalComments
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.whlComments
- Start Command Prompt with Administrative Permission
- Enter following command
python -m pip install --upgrade pip - Next Enter command
pip install tensorflow
1 Comment
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-previewand for install the TensorFlow 2 bye pip you can use:pip install tf-nightly-gpu-2.0-preview for GPU andpip install tf-nightly-2.0-previewfor CPU.
1 Comment
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.whl1 Comment
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.
Comments
I was facing the same issue. I tried the following and it worked.installing for Mac OS X, anaconda python 2.7
pip uninstall tensorflowexport TF_BINARY_URL=<get the correct url from http://tflearn.org/installation/>pip install --upgrade $TF_BINARY_URL
Installed tensorflow-1.0.0





























