You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
File "/home/user/Desktop/edgeb_fastapiCrud/app/main.py", line 9, in
from app import events, users
File "/home/user/Desktop/edgeb_fastapiCrud/app/events.py", line 33, in
@router.get("/events")
raise PydanticUndefinedAnnotation.from_name_error(e) from e
pydantic.errors.PydanticUndefinedAnnotation: name 'uuid' is not defined
The issue seems to be that FastAPI compatibility with Pydantic V2 is not quite there yet. If you force reinstall V1 of Pydantic, that should get you up and running with the example while FastAPI gets it sorted out. We are working on filing a bug with them, but they've already acknowledged the problem in their discussion so they are probably already working to fix it.
Here's the command to force install the older version of Pydantic with pip:
File "/home/user/Desktop/edgeb_fastapiCrud/app/main.py", line 9, in
from app import events, users
File "/home/user/Desktop/edgeb_fastapiCrud/app/events.py", line 33, in
@router.get("/events")
raise PydanticUndefinedAnnotation.from_name_error(e) from e
pydantic.errors.PydanticUndefinedAnnotation: name 'uuid' is not defined
For further information visit https://errors.pydantic.dev/2.0.3/u/undefined-annotation
The text was updated successfully, but these errors were encountered: