How to Solve NameError: name 'dataclass' is not defined -- dataclasses
Solution: Import the 'dataclass' module
To Solve the error, add the following line to the top of your code.
from dataclasses import dataclass
For more information:
Python dataclasses dataclass