Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 16566

How to solve Syntax error when importing tensorflow 1.8.0?

$
0
0

I imported tensorflow as:import tensorflow as tf

and got this error:

Traceback (most recent call last):  File "C:\Users\USER\Downloads\import_tensorflow.py", line 1, in <module>    import tensorflow as tf  File "C:\Users\USER\AppData\Local\Programs\Python\Python312\Lib\site-packages\tensorflow\__init__.py", line 24, in <module>    from tensorflow.python import pywrap_tensorflow  # pylint: disable=unused-import    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  File "C:\Users\USER\AppData\Local\Programs\Python\Python312\Lib\site-packages\tensorflow\python\__init__.py", line 49, in <module>    from tensorflow.python import pywrap_tensorflow  File "C:\Users\USER\AppData\Local\Programs\Python\Python312\Lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>    from tensorflow.python.pywrap_tensorflow_internal import *  File "C:\Users\USER\AppData\Local\Programs\Python\Python312\Lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 114    def TFE_ContextOptionsSetAsync(arg1, async):                                         ^^^^^SyntaxError: invalid syntax

reults of pip list and pip show shows that I have tensorflow installed on my computer...

pip list:tensorflow 1.8.0

pip show tensorflow:

Version: 1.8.0Summary: TensorFlow helps the tensors flowHome-page: https://www.tensorflow.org/Author: Google Inc.Author-email: opensource@google.comLicense: Apache 2.0 ```

Viewing all articles
Browse latest Browse all 16566

Trending Articles