FastAPI and many libraries are not yet fully compatible with Python 3.13. Use a stable version like 3.11.x.
Make sure to clear existing env and recreate new env and also check pydantic and fastapi compatible version for 3.11.x