So, I am trying to run a Python notebook using Jupyter. The notebook currently only contains some import statements as I am just setting up the document before starting the project. However, I encountered an error saying:
`TypeError Traceback (most recent call last)
~AppDataLocalTempipykernel_2123284111605.py in <module>
17 #import numpy as np
18 #from scipy import stats
---> 19 import tensorflow as tf
20 #import matplotlib.pyplot as plt
21 #import seaborn as sns
~anaconda3libsite-packagestensorflow__init__.py in <module>
43 _tf2.enable()
44
---> 45 from tensorflow._api.v2 import __internal__
46 from tensorflow._api.v2 import __operators__
47 from tensorflow._api.v2 import audio
~anaconda3libsite-packagestensorflow_apiv2__internal____init__.py in <module>
6 import sys as _sys
7
----> 8 from tensorflow._api.v2.__internal__ import autograph
9 from tensorflow._api.v2.__internal__ import decorator
10 from tensorflow._api.v2.__internal__ import dispatch
~anaconda3libsite-packagestensorflow_apiv2__internal__autograph__init__.py in <module>
6 import sys as _sys
7
----> 8 from tensorflow.python.autograph.core.ag_ctx import control_status_ctx # line: 34
9 from tensorflow.python.autograph.impl.api import tf_convert # line: 493
~anaconda3libsite-packagestensorflowpythonautographcoreag_ctx.py in <module>
19 import threading
20
---> 21 from tensorflow.python.autograph.utils import ag_logging
22 from tensorflow.python.util.tf_export import tf_export
23
~anaconda3libsite-packagestensorflowpythonautographutils__init__.py in <module>
15 """Utility module that contains APIs usable in the generated code."""
16
---> 17 from tensorflow.python.autograph.utils.context_managers import control_dependency_on_returns
18 from tensorflow.python.autograph.utils.misc import alias_tensors
19 from tensorflow.python.autograph.utils.tensor_list import dynamic_list_append
~anaconda3libsite-packagestensorflowpythonautographutilscontext_managers.py in <module>
17 import contextlib
18
---> 19 from tensorflow.python.framework import ops
20 from tensorflow.python.ops import tensor_array_ops
21
~anaconda3libsite-packagestensorflowpythonframeworkops.py in <module>
28 from absl import app
29 import numpy as np
---> 30 from numpy import typing as npt
31
32 from google.protobuf import message
~anaconda3libsite-packagesnumpytyping__init__.py in <module>
156 # further down in this file
157
--> 158 from numpy._typing import (
159 ArrayLike,
160 DTypeLike,
~anaconda3libsite-packagesnumpy_typing__init__.py in <module>
162 _ShapeLike as _ShapeLike,
163 )
--> 164 from ._dtype_like import (
165 DTypeLike as DTypeLike,
166 _DTypeLike as _DTypeLike,
~anaconda3libsite-packagesnumpy_typing_dtype_like.py in <module>
15
16 from ._shape import _ShapeLike
---> 17 from ._generic_alias import _DType as DType
18
19 from ._char_codes import (
~anaconda3libsite-packagesnumpy_typing_generic_alias.py in <module>
239
240 if TYPE_CHECKING or sys.version_info >= (3, 9):
--> 241 _DType = np.dtype[ScalarType]
242 NDArray = np.ndarray[Any, np.dtype[ScalarType]]
243 else:
TypeError: 'numpy._DTypeMeta' object is not subscriptable`
I have tried uninstalling and reinstalling the TensorFlow package along with NumPy. I have also tried updating the packages, as well as installing specific versions, but still no luck. I expected these actions to resolve the import errors and allow my code to run without issues. However, when I fix one error, a different error appears.