Cannot install TensorFlow 1.x - python

I am trying to install Tensorflow 1.14 for a package that I am trying to use. I tried:
pip3 uninstall tensorflow
Then I tried to install Tensorflow 1.14 using:
pip3 install tensorflow==1.14
and I get the following error
ERROR: Could not find a version that satisfies the requirement tensorflow==1.14 (from versions: 2.2.0rc3, 2.2.0rc4, 2.2.0, 2.3.0rc0, 2.3.0rc1, 2.3.0rc2) ERROR: No matching distribution found for tensorflow==1.14
I also tried making a new virtual env and tried the following commands but it didn't work. Is there any way to install Tensorflow 1?

What I've found on discourse:
You just need to make sure you’re using Python 3.5, 3.6 or 3.7. TensorFlow 1.15 does not support Python 3.8

It works for me to install 1.x tensorflow with the following command:
pip3 install https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.14.0-py3-none-any.whl

Try installing the final version of TensorFlow 1.15 using,
pip install tensorflow==1.15
Make sure that you are using a python3 virtual environment and Python version is 3.6 or above.
Or you may use Conda environment and install using
conda install -c conda-forge tensorflow=1.15

On top of what being said (i.e. the version), be sure that it is 64-bits version because Tensorflow is not working with Python 32 bits (or at least the recent versions).
You can check your version by typing python in the command line and check what appears.
For example, this is for 32 bits
and for 64bits

I faced the same issue while installing tensorflow version 1.14.0. The best solution i tried is:
Note that your Python version is 3.7.8
Steps:
Open python 3.7.8 script folder C:\Users\mypc\AppData\Local\Programs\Python\Python37\Scripts folder and type "cmd" in above bar, which opens it in the command prompt.
To install tensorflow-1.14.0 type : pip install tensorflow==1.14.0
To install keras-2.2.4 type : pip install keras==2.2.4

From this issue on the Tensorflow Github titled Tensorflow 1.x not available for python 3.8:
Saduf2019: TensorFlow 1.x even 2.1 does not support Python 3.8
mihaimaruseac: We don't add new versions of Python for old releases. If you want to use TF 1.15, you have to use Python 3.7 or lower. If you want to use Python 3.8 you have to use TF 2.2 or newer.
Sounds like support for newer versions of Python > 3.7 won't be available for any tensorflow 1.x < 1.15.

Related

Why can't I install tensorflow on windows 10 (python 3.9.0 pip 21.0.1)?

I tried pip installing it using command prompt, and got this error
py -m pip install tensorflow
ERROR: Could not find a version that satisfies the requirement tensorflow
ERROR: No matching distribution found for tensorflow
Currently the Tensorflow only supports for python 3.5 - 3.8. As you are on 3.9 it will now work, you need to downgrade your python version for now. When it will support python 3.9 you can upgrade to that version.
Tensorflow is supporting up to Python 3.8 as per their documentation.
You have to create new environment with Python 3.8

How to install TensorFlow with Python 3.8

Whenever I try to install TensorFlow with pip on Python 3.8, I get the error that TensorFlow is not found. I have realized later on that it is not supported by Python 3.8.
How can I install TensorFlow on Python 3.8?
As of May 7, 2020, according to Tensorflow's Installation page with pip, Python 3.8 is now supported. Python 3.8 support requires TensorFlow 2.2 or later.
You should be able to install it normally via pip.
Prior to May 2020:
As you mentioned, it is currently not supported by Python 3.8, but is by Python 3.7.
You want to have virtualenv installed. You also need Python 3.7.
Then you can just start a virtualenv with -p python3.7 and install it using pip like you did before:
virtualenv --system-site-packages -p python3.7 DEST_DIR
source ./DEST_DIR/bin/activate
pip install --upgrade pip
pip install --upgrade tensorflow
Tensorflow does not support Python 3.8 at the moment. The latest supported Python version is 3.7. A solution is to install Python 3.7, this will not affect your codes since Python 3.7 and 3.8 are very similar. Right now Python 3.7 is supported by more frameworks like TensorFlow. Soon Python 3.8 will have more supported frameworks, and that´s when you can install TensorFlow for Python 3.8.
Currently it does support python 3.8 all we need to do is create a new environment ,select 'update index' , select uninstalled and one can find tensorflow for installing
An option is to install it for Python 3.7 which is supported for Tensorflow 2.0. If you have anaconda navigator, you can create an environment with Python 3.7 specifically for installing tensorflow. Open your terminal in this environment and then type:
conda install tensorflow
Afterwards, you could install every other package you need and that's it.
Instead of pip or conda command, I used pip3 command and it worked.
I tried this in Anaconda and faced problems when installing Tensorflow 1.14.0.
Steps to Resolve
Create a new environment
Check the python version
conda search python
I found version 3.8.0. Tensorflow 1.14 is not supported with this version.
Next step is to downgrade python in new environment to 3.7.0
conda install python=3.7.0
Once this is done, install TensorFlow 1.14.

Force Anaconda to install tensorflow 1.14

Now, the official TensorFlow on Anaconda is 2.0. My question is how to force Anaconda to install an earlier version of TensorFlow instead. So, for example, I would like Anaconda to install TensorFlow 1.14 as plenty of my projects are depending on this version.
You can force installing a certain version of any package found on Anaconda using simply an = operator with the package version attached to it.
So, if you want to install tensorflow 1.14, you can run the following command:
conda install -c conda-forge tensorflow=1.14
You can replace 1.14 with any other versions. To see the available versions of tensorflow on Anaconda, you can run:
conda search tensorflow
first find the python version of tensorflow==1.14.0, then find the Anaconda version by python version.
e.g. tensorflow 1.14.0 can work well on python36, and Anaconda 3.5.1 has python36. So install the Anaconda 3.5.1, then install tensorflow==1.14.0 by pip

Tensorflow install fails with "compiletime version 3.5 of module does not match runtime version 3.6"

I tried installing from pip:
pip3 install --user --no-cache https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.4.0-cp36-cp36m-linux_x86_64.whl
Then tried importing and got:
Using TensorFlow backend.
/usr/lib64/python3.6/importlib/_bootstrap.py:205: RuntimeWarning:
compiletime version 3.5 of module
'tensorflow.python.framework.fast_tensor_util' does not match runtime
version 3.6
return f(*args, **kwds)
2017-11-10 09:35:01.206112: I
tensorflow/core/platform/cpu_feature_guard.cc:137] Your CPU supports
instructions that this TensorFlow binary was not compiled to use: SSE4.1
SSE4.2 AVX
Questions:
I don't understand why the wheel says 3.6, but I get the warning about 3.5
I want to compile to optimize for my cpu, so can I use pip to install from source rather than from binary wheel?
RuntimeWarning: compiletime version 3.5 of module 'tensorflow.python.framework.fast_tensor_util' does not match runtime version 3.6
This is a known issue, which is got prioritized and likely to be fixed soon. Right now the workaround is to use python 3.5.
UPDATE:
The issue has been fixed in the nightly tensorflow builds: "tf-nightly and tf-nightly-gpu now has a python3.6 binary built from scratch for Linux."
I.e., the following command should work with python 3.6:
# tf-nightly or tf-nightly-gpu
pip3 install tf-nightly
Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX
This warning comes from the fact that the default tensorflow distributions are compiled without CPU extensions support (more on this here). If you want to get a CPU optimized tensorflow package, your only option is to build it yourself. It's a bit tedious, but absolutely doable. The build will produce the wheel file, which you can install with just
pip3 install /path/to/the/tensorflow.whl
But if you just want to suppress the warning, this will do:
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
I got the same issue and I was able to solve it by installing 1.3 version rather than using 1.4 of tensorflow. Use the following command to do so.
pip3 install tensorflow==1.3.0
I encountered the same problem and I fixed it by:
pip install --ignore-installed tensorflow
The problem occurred because I complied a local version of tensorflow (to enable some CPU features) with python 3.5 earlier. I installed python 3.6 recently and the new tensorlfow already supported those CPU features, so I just installed the official version.
Update:
After some update of tensorflow the approach above doesn't work any more.
Another workaround is using virtual environment such as anaconda to create a python3.5 environment:
conda create -n py35 python=3.5
source activate py35
pip install tensorflow
To work with ipython or jupyter notebook, be sure to install ipykernel inside the virtual environment:
pip install ipykernel
Just install 1.3 version of tensorflow. Problem solved.
pip install tensorflow==1.3.0
solution 1.
the way I solved this is by downgrading to the latest python3.5, go to python.org download the latest Python3.5, install it and then use normalpip3 install tensorflow this should be able to fix the issue if not try the second solution.
solution 2(also you need to downgrade from python3.6 to python3.5
I used Pycharm to solve the issue, I created a project inside the pycharm editor then I changed the Project Interpreter from python3.6 to python3.5, to do this as well go to File > Preferences search for Project Interpreter, and from the drop-down menu change from python3.6 to python3.5
hit Apply wait for the operation to finish
and then in the same window using the + icon
A window will appear that will let you search and install python libraries easily without using pip, in our case we want tensorflow, so just search tensorflow, select tensorflow on search result and click Install Package this will install the package
and voila you're ready to roll, now you got tensorflow installed on your python3.5, keep that in mind.
For now you can use python version less than 3.6.x because now Tensorflow 1.4.0 is not working properly with python 3.6.x. It will surly work.
This issue was resolved on ubuntu 17.10 by running
$ conda install tensorflow
i use tensorflow 1.4.0, meet the same problem. but you can use tensorflow 1.6.0, now.

Installing TensorFlow on Windows (Python 3.6.x)

I'm trying to install TensorFlow on Windows.
I tried to install it with pip, but I always get the same error message:
... is not a supported wheel on this platform.
I first tried it with Python 3.5.1, now I upgraded to 3.6.0b4, but it makes no difference.
Python:
Python 3.6.0b4 (default, Nov 22 2016, 05:30:12) [MSC v.1900 64 bit (AMD64)] on win32
pip:
pip 9.0.1 from ...\python\lib\site-packages (python 3.6)
To be exact, I tried the following two commands:
pip install --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-0.12.0rc0-cp35-cp35m-win_amd64.whl
pip install --upgrade https://storage.googleapis.com/tensorflow/windows/gpu/tensorflow_gpu-0.12.0rc0-cp35-cp35m-win_amd64.whl
they output the following:
> tensorflow-0.12.0rc0-cp35-cp35m-win_amd64.whl is not a supported wheel on this platform.
> tensorflow_gpu-0.12.0rc0-cp35-cp35m-win_amd64.whl is not a supported wheel on this platform.
Does anyone know how to solve this problem? I'm not sure where I'm making a mistake.
Thanks!
Edit 1
Btw, I also tried pip install tensorflow and pip install tensorflow-gpu like suggested here. I got the following output:
> 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
Update 15.11.2017
It seems that by now it is working like one would expect. Running the following commands using the following pip and python version should work.
Installing with Python 3.6.x
Version
Python: 3.6.3
pip: 9.0.1
Installation Commands
The following commands are based of the following installation guide here.
using cmd
C:> pip3 install --upgrade tensorflow // cpu
C:> pip3 install --upgrade tensorflow-gpu // gpu
using Anaconda
C:> conda create -n tensorflow python=3.5
C:> activate tensorflow
(tensorflow)C:> pip install --ignore-installed --upgrade tensorflow
(tensorflow)C:> pip install --ignore-installed --upgrade tensorflow-gpu
Additional Information
A list of common installation problems can be found here.
You can find an example console output of a successful tensorflow cpu installation here.
Old response:
Okay to conclude; use version 3.5.2 !
Neither 3.5.1 nor 3.6.x seem to work at the moment.
Versions:
Python 3.5.2 pip 8.1.1 .. (python 3.5)
Commands:
// cpu
C:> pip install --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-0.12.0rc0-cp35-cp35m-win_amd64.whl
// gpu
C:> pip install --upgrade https://storage.googleapis.com/tensorflow/windows/gpu/tensorflow_gpu-0.12.0rc0-cp35-cp35m-win_amd64.whl
If you are using anaconda distribution, you can do the following to use python 3.5 on the new environnement "tensorflow":
conda create --name tensorflow python=3.5
activate tensorflow
conda install jupyter
conda install scipy
pip install tensorflow
# or
# pip install tensorflow-gpu
It is important to add python=3.5 at the end of the first line, because it will install Python 3.5.
Source: https://github.com/tensorflow/tensorflow/issues/6999#issuecomment-278459224
After searching a lot and trying to install and reinstall Python, i found the solution was very simple
use the following for windows
python -m pip install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.12.0-py3-none-any.whl
change to following on mac
python3 -m pip install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.12.0-py3-none-any.whl
for Anaconda use corresponding conda
Tensorflow now works with python 3.6.4, don't use python builds that came after 3.6.4 and most importantly tensorflow doesn't work on Python 3.7.2. You can download 3.6.4 for windows from here python 3.6.4.
Then just simply run pip install tensorflow-gpu
At the time of this writing, there is no official support for TensorFlow with Python 3.6 on Windows. The recommendation is to build TensorFlow yourself.
Some people have already done this and provide *.whl files that you can directly install with pip. These are unofficial, so use at your own risk:
http://www.lfd.uci.edu/%7Egohlke/pythonlibs/#tensorflow
You can simply download them and install them with pip install <filename>.whl.
See also this GitHub comment.
I was having Python 3.6 and was facing the issue as "No module named tensorflow" on "pip install tensorflow". Turned out as my machine was of 64 bit while the Python 3.6 version installed was for 32 bit. Uninstalled it, reinstalled the Python 3.6 x64 version, pip installed tensorflow, problem solved.
Tensorflow is now supported on Python 3.6. Just make sure that the Python installation is 64 bit on a 64 bit machine and that pip is the latest (pip install --upgrade pip).
After that (pip install --upgrade tensorflow) works like a charm.
Tensorflow indeed supports Python 3.6.X version, but only for 64-bit architecture. Here is the link where you can download Python 3.6.X 64-bit version
For Pip installation on Windows and 64-bit Python 3.5:
CPU only version:
C:\> pip install --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-0.12.0rc0-cp35-cp35m-win_amd64.whl
For the GPU version:
C:\> pip install --upgrade https://storage.googleapis.com/tensorflow/windows/gpu/tensorflow_gpu-0.12.0rc0-cp35-cp35m-win_amd64.whl
References:
Tensorflow installation issue on windows "tensorflow_gpu-0.12.0rc0-cp35-cp35m-win_amd64.whl is not a supported wheel on th is platform.".
https://www.tensorflow.org/versions/r0.12/get_started/os_setup.html
Also see tensorflow not found in pip.
Tensorflow in Now supporting Python 3.6.0 .....I have successfully installed the Tensorflow for Python 3.6.0
Using this Simple Instruction // pip install -- tensorflow
[enter image description here][1]
[1]: https://i.stack.imgur.com/1Y3kf.png
Installing collected packages: protobuf, html5lib, bleach, markdown, tensorflow-tensorboard, tensorflow
Successfully installed bleach-1.5.0 html5lib-0.9999999 markdown-2.6.9 protobuf-3.4.0 tensorflow-1.3.0 tensorflow-tensorboard-0.1.5
Same issue with you .
py3.6x
win10 pro x64
pip 9.0.1
Issue message
"Could not find a version that satisfies the requirement tensorflow (from versions: )
No matching distribution found for tensorflow"
Maybe you can try py3.5
Windows batch file for installing TensorFlow and Python 3.5 on Windows. The issue is that as of this date, TensorFlow is not updated to support Python 3.6+ and will not install. Additionally, many systems have an incompatible version of Python. This batch file should create a compatible environment without effecting other Python installs. See REM comments for assumptions.
REM download Anaconda3-4.2.0-Windows-x86_64.exe (contains python 3.5) from https://repo.continuum.io/archive/index.html
REM Assumes download is in %USERPROFILE%\Downloads
%USERPROFILE%\Downloads\Anaconda3-4.2.0-Windows-x86_64.exe
REM change path to use Anaconda3 (python 3.5).
PATH %USERPROFILE%\Anaconda3;%USERPROFILE%\Anaconda3\Scripts;%USERPROFILE%\Anaconda3\Library\bin;%PATH%
REM update pip to 9.0 or later (mandatory)
python -m pip install --upgrade pip
REM tell conda where to load tensorflow
conda config --add channels conda-forge
REM elevate command (mandatory) and install tensorflow - use explicit path to conda %USERPROFILE%\Anaconda3\scripts\conda
powershell.exe -Command start-process -verb runas cmd {/K "%USERPROFILE%\Anaconda3\scripts\conda install tensorflow"}
Be sure the above PATH is used when invoking TensorFlow.
Follow these steps to install ternsorflow:
(step 1) conda create -n py35 python=3.5
(step 2) activate py35
(step 3) conda create -n tensorflow
(step 4,only for GPU) pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/gpu/tensorflow_gpu-1.1.0-cp35-cp35m-win_amd64.whl
Just found Tensorflow 1.1 for python 3.6 on windows x64 (including GPU version, but i tested only cpu): http://www.lfd.uci.edu/~gohlke/pythonlibs/#tensorflow. Unofficial apparently, but worked for me when I import tensorflow or tflearn in my code. They have scipy for windows there and bunch of other packages.
For some reason pip install URL returns code 404, so the installation would be the following:
1) Download protobuf whl package from here: http://www.lfd.uci.edu/~gohlke/pythonlibs/vu0h7y4r/protobuf-3.3.0-py3-none-any.whl
2) pip install {DownloadFolder}\protobuf-3.3.0-py3-none-any.whl
3) Download TF whl file: http://www.lfd.uci.edu/~gohlke/pythonlibs/vu0h7y4r/tensorflow-1.1.0-cp36-cp36m-win_amd64.whl
4) pip install {DownloadFolder}\tensorflow-1.1.0-cp36-cp36m-win_amd64.whl
It worked for me.
For someone w/ TF 1.3:
Current TensorFlow 1.3 support Python 3.6, and then you need cuDNN 6 (cudnn64_6.dll)
Based on Tensorflow on windows - ImportError: DLL load failed: The specified module could not be found
and this: https://github.com/tensorflow/tensorflow/issues/7705
On 2/22/18, when I tried the official recommendation:
pip3 install --upgrade tensorflow
I got this error
Could not find a version that satisfies the requirement tensorflow
But instead using
pip install --upgrade tensorflow
installed it ok. (I ran it from the ps command prompt.)
I have 64-bit windows 10, 64-bit python 3.6.3, and pip3 version 9.0.1.
Tensor flow on 32 bit machine.
There is no official build out for 32 bit, but still there is a workaround for that, follow the link http://cudamusing.blogspot.in/2015/11/building-tensorflow-for-jetson-tk1.html. I would not suggest doing this big reason is its not possible to follow the process every time there is a change in official tensor flow code.
I had the same issue, but I followed the following steps:-
I had Python 3.6.5 (32 bit) installed on my desktop, but from all the research I did, I could conclude that Tensorflow runs only on Python 3.5x or 3.6x 64 bit versions. So I uninstalled it and Installed Python 3.5.0 instead.
I ran Python 3.5.0 as an administrator. This step is necessary for Windows as, without it, the system doesn't get any privileges and can't install tensorflow.
Install Pip3 using command:- python -m pip install --upgrade pip
Once the newest version (10.0.1 in my case) is installed, you can install tensorflow usin command:- pip3 install --upgrade tensorflow
Your tensorflow will be downloaded and installed. For further help on how to run tensorflow programs, go to https://www.tensorflow.org/get_started/premade_estimators
https://i.stack.imgur.com/1Y3kf.png
pip install -- tensorflow
This worked for me for this version of python
Python 3.6.4 : : Anaconda, Inc.
Tensorflow is not compatible with python3.7 and spyder3.3.1
To work with stable tensorflow version
follow the procedure
windows-->search-->Anaconda prompt-->right click -->click Run as adminstrator
Below command create the virtual environment which does not disturb existing projects
conda create -n projectname
Below command activates your virtual environment within this directory installed package will not disturb your existing project.
activate projectname
Below command installs python 3.6.7 and spyder 3.2.3 as well
conda install spyder=3.2.3
Below mentioned tensorflow version works without any error. As per your need, you can install tensorflow version specifically.
pip install tensorflow==1.3.0
To open spyder
spyder
To exit form Virtual environment
deactivate
For the GPU version, see my answer here.
In short, install Anaconda, then open an anaconda terminal and type conda create --name tf_gpu tensorflow-gpu
You are then free to use the conda environment tf_gpu
Tensor flow has only support for python 2.7 3.4 3.5
Other python versions are not supported
So you please install the supported python version and try it again.
The official link is https://www.tensorflow.org/install/install_linux#InstallingAnaconda
It provides how to install it with anaconda .
This will help you

Categories