TensorFlow not found using pip
PythonTensorflowPipPython Problem Overview
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.
Python Solutions
Solution 1 - Python
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
Solution 2 - Python
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
Solution 3 - Python
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.
Solution 4 - Python
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
Solution 5 - Python
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.
Solution 6 - Python
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
Solution 7 - Python
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
Solution 8 - Python
Install Python 3.5.x 64 bit amd version https://www.python.org/downloads/release/python-351/">here</a>;. 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
Solution 9 - Python
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
Solution 10 - Python
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.
Solution 11 - Python
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</strike> (page no longer exists)
Update 2/23/17 Documentation moved to: https://www.tensorflow.org/install
Solution 12 - Python
- Install python by checking Add Python to Path
- pip3 install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.12.0-py3-none-any.whl
This works for windows 10.0
Solution 13 - Python
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
Solution 14 - Python
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
Solution 15 - Python
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.
Solution 16 - Python
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.
Solution 17 - Python
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
Solution 18 - Python
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.
Solution 19 - Python
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
Solution 20 - Python
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.
-
check python version:
python --version
-
if version >
3.6.x
then follow step 3, otherwise stop, the problem may be somewhere else -
conda search python
-
conda install python=3.6.6
-
Check version again:
python --version
-
If version is correct, install tensorflow (step 7)
-
pip install tensorflow
Solution 21 - Python
Following these steps allows you to install tensorflow and keras:
-
Download Anaconda3-5.2.0 which comes with python 3.6 from https://repo.anaconda.com/archive/
-
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
Solution 22 - Python
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 樂
Solution 23 - Python
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.
Solution 24 - Python
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
Solution 25 - Python
- Start Command Prompt with Administrative Permission
- Enter following command
python -m pip install --upgrade pip
- Next Enter command
pip install tensorflow
Solution 26 - Python
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.
Solution 27 - Python
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
Solution 28 - Python
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.
Solution 29 - Python
I was facing the same issue. I tried the following and it worked. installing for Mac OS X, anaconda python 2.7
export TF_BINARY_URL=<get the correct url from http://tflearn.org/installation/>
pip install --upgrade $TF_BINARY_URL
Installed tensorflow-1.0.0
Solution 30 - Python
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
Solution 31 - Python
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
Solution 32 - Python
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:
- 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
- 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)
- 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
-
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”.
> 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.
> d. Verify whether python installed correctly. Open a command prompt > and type “python”. It should show the version of Python.
- Install Visual Studio
> 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
- CUDA 9.0 toolkit
> a. Click "Link to CUDA 9.0 toolkit" above, download “Base Installer” > > > > b. Install CUDA 9.0
- 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
> h. Add three folders (bin, include, lib) inside the extracted file to > environment
> 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.
- Install tensorflow-gpu
> a. Open a command prompt and type “pip install > --upgrade tensorflow-gpu” > > > > b. It will install tensorflow-gpu
-
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!
-
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())
Solution 33 - Python
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
Solution 34 - Python
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!
Solution 35 - Python
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
Solution 36 - Python
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
Solution 37 - Python
If your command pip install --upgrade tensorflow
compiles, 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.
Solution 38 - Python
Currently PIP does not have a 32bit version of tensorflow, it worked when I uninstalled python 32bit and installed x64
Solution 39 - Python
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...
- Install python3 via the official Windows way for the Windows system (the cygwin system is separate, so uses a different python)
- 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.
3. 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
.
Solution 40 - Python
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)
-
Follow the instructions on the Anaconda download site to download and install Anaconda. https://www.continuum.io/downloads
-
Create a conda environment named tensorflow by invoking the following command:
C:> conda create -n tensorflow pip python=3.5
-
Activate the conda environment by issuing the following command:
C:> activate tensorflow (tensorflow)C:> # Your prompt should change
-
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
Solution 41 - Python
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.
Solution 42 - Python
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
Solution 43 - Python
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
Solution 44 - Python
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.
Solution 45 - Python
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
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.
Solution 46 - Python
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.
Solution 47 - Python
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:
-
A
win32
package is missing because TensorFlow's dependency, Bazel, only supportswin64
. -
For
win64
, only 3.5+ is supported because earlier versions are compiled with compilers without C++11 support.
Solution 48 - Python
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.
Solution 49 - Python
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
Solution 50 - Python
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.
Solution 51 - Python
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
Solution 52 - Python
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
Solution 53 - Python
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
Solution 54 - Python
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
references 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
Solution 55 - Python
You may try this
pip install --upgrade tensorflow
Solution 56 - Python
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