I have a ipynb notebook running Python 3.10.7 64-bit on MacOS in Visual Studio. I did:
pip install tensorflow
which resulted in the following error:
ERROR: Could not find a version that satisfies the requirement tensorflow (from versions: none)
ERROR: No matching distribution found for tensorflow
I then used the following code:
pip install https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.8.0-py3-none-any.whl
Which appeared to work fine installing tensorflow, but the following code:
from tensorflow.keras.layers.experimental.preprocessing import StringLookup
from tensorflow import keras
Yields this error:
Traceback (most recent call last):
File ~/Library/Python/3.10/lib/python/site-packages/IPython/core/interactiveshell.py:3378 in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
Cell In [9], line 1
from tensorflow.keras.layers.experimental.preprocessing import StringLookup
File /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/tensorflow/__init__.py:24
from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
File /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/tensorflow/python/__init__.py:49
from tensorflow.python import pywrap_tensorflow
File /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/tensorflow/python/pywrap_tensorflow.py:58
from tensorflow.python.pywrap_tensorflow_internal import *
File /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/tensorflow/python/pywrap_tensorflow_internal.py:114
def TFE_ContextOptionsSetAsync(arg1, async):
^
SyntaxError: invalid syntax
I attempted to use a different version of Python (3.6 and 3.7), but the error still persists. Any suggestions?