Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FastAPI CRUD name 'uuid' is not defined #106

Open
Diwas2055 opened this issue Jul 17, 2023 · 2 comments
Open

FastAPI CRUD name 'uuid' is not defined #106

Diwas2055 opened this issue Jul 17, 2023 · 2 comments

Comments

@Diwas2055
Copy link

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

@raddevon
Copy link
Contributor

Thank you for reporting this! It seems to be an issue between FastAPI and Pydantic that is breaking the project. We're looking into it…

@raddevon
Copy link
Contributor

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:

pip install --force-reinstall -v "pydantic==1.10"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants