Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does TensorFlow 1.9 support Python 3.7

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?

like image 984
chenxu Avatar asked Jul 08 '18 19:07

chenxu


People also ask

Which Python version is compatible with TensorFlow?

Requirements. The TensorFlow Python API supports Python 2.7 and Python 3.3+. The GPU version works best with Cuda Toolkit 7.5 and cuDNN v5. Other versions are supported (Cuda toolkit >= 7.0 and cuDNN >= v3) only when installing from sources.

Which TensorFlow version is compatible with Python 3.8 3?

Python 3.8 support requires TensorFlow 2.2 or later.

Does Python 3.10 support TensorFlow?

*? @I'mahdi, I do know that tensorflow supports Python 3.10.


3 Answers

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 
like image 166
Biranchi Avatar answered Sep 23 '22 02:09

Biranchi


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

like image 30
bconstanzo Avatar answered Sep 20 '22 02:09

bconstanzo


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.

like image 42
Outcast Avatar answered Sep 20 '22 02:09

Outcast