21

I'm hesitating whether to downgrade to Python 3.6 or install a new version of TensorFlow.

Does TensorFlow 1.9 support Python 3.7?

nbro
  • 15,395
  • 32
  • 113
  • 196
chenxu
  • 251
  • 1
  • 2
  • 4
  • you can run python 3.7 with Tensorflow 1.12 from here https://github.com/fo40225/tensorflow-windows-wheel/tree/master/1.12.0 – Umer Nov 22 '18 at 20:01
  • What do you mean by run it from there? shall I download the file and where to save it? – ElSheikh Dec 09 '18 at 17:29
  • I have built the .whl for tensorflow 1.12.0 with python 3.7.2 pip3 install tensorflow-1.12.0-cp37-cp37m-linux_x86_64.whl ensure pip3 is pointing to 3.7.2 file is here https://sourceforge.net/projects/getprathamos/files/Adyah/BD_ML/tensorflow-1.12.0-cp37-cp37m-linux_x86_64.whl right now only cpu build is available – Rakesh Kumar Khandelwal Jan 18 '19 at 18:19

10 Answers10

15

I was able to install Tensorflow 1.12.0 with Python 3.7 on MacOS, with the following command.

sudo python3 -m pip install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.12.0-py3-none-any.whl
Biranchi
  • 16,120
  • 23
  • 124
  • 161
12

Not yet. It seems there are some variables named "async", which has become a keyword in 3.7. Shouldn't be too difficult to fix, but still a problem.

Source: https://github.com/tensorflow/tensorflow/issues/20444

bconstanzo
  • 566
  • 4
  • 10
5

Probably not yet.

First of all, you will probably get a SyntaxError: invalid syntax because some parameters and variables at the pywrap_tensorflow_internal.py module have the name async which is a reserved keyword in Python 3.7.0 (see also this post).

However, you can solve this by simply changing the name of all these (Ctrl + R and Replace All) from async to for example async1.

The problem is that then you will probably get a ImportError: No module named '_pywrap_tensorflow_internal' which perhaps may be fixed for any previous version before Python 3.7.0 as this post on StackOverflow suggests but personally I could not fix it on my laptop with Python 3.7.0 .

Consequently, I simply downgraded to Python 3.6.6 and now Tensorflow is working fine.

Outcast
  • 4,967
  • 5
  • 44
  • 99
2

There is a whl built here. However in my run it was cpu version.

https://www.lfd.uci.edu/~gohlke/pythonlibs/

halidziya
  • 80
  • 8
2

as of Aug 26tH, there is an update on the tensorflow github site https://github.com/tensorflow/tensorflow/pull/21202

user3325025
  • 654
  • 7
  • 10
2

Tensorflow 1.13.1 now supports Python 3.7.

Jerry Chong
  • 7,954
  • 4
  • 45
  • 40
1

Finally Worked for me!

On Python 3.6.4 (even 3.6.5 failed for me) Install Python3.6.4 from here: https://www.python.org/downloads/mac-osx/

If you're facing issues with Python pkgs that you already had on you older version just revert it using this post: python location on mac osx

Kohn1001
  • 3,507
  • 1
  • 24
  • 26
1

According to the comments on github see https://github.com/tensorflow/tensorflow/issues/20517#issuecomment-457185528

by member av8ramit "We are aiming to try and have Windows and Ubuntu python binaries by rc2 or the official." the estimated release date for 2019-02-03

however on https://github.com/winpython/winpython/issues/687 one can read from a winpython contributor: "Tensorflow-2 is 2019, Tensorflow-1 on Python-3.7 is still not in sight"

grosser
  • 11
  • 3
0

I found this to work after searching for a while.

As Tensorflow only supports Python 3.6 as of now, you can install a different version of python alongside your standard one. Here are the steps I followed:

You'll normally find your new python install under /usr/local/bin. Now you can create a new virtualenv specifying the python version with:

  • virtualenv --python=python3.6 env3.6
  • Get into the virtualenv running the command source env3.6/source/bin/activate.
  • Install tensorflow with the classic pip install tensorflow
  • Profit
belvederef
  • 2,195
  • 19
  • 16
0

First of all,

*conda create -n yourenvname python=3.6    
*conda activate yourenvname 
*pip install tensorflow

then it will work like rock.

Cettt
  • 11,460
  • 7
  • 35
  • 58
Voontent
  • 719
  • 5
  • 8