How to Solve NameError: name 'FastAPI' is not defined -- fastapi

Solution: Import the 'FastAPI' module

# Add the following line to the top of your code
from fastapi import FastAPI

 

For more information:
fastapi FastAPI