cookiecutter-spacy-fastapi
cookiecutter-spacy-fastapi copied to clipboard
Cannot start uvicorn with newly generated app
Python 3.9 clean install Ubuntu 21.04 Paths redacted for clarity Uvicorn works for a simple app
Traceback (most recent call last):
File ".../main.py", line 2, in <module>
from app.api import app
File ".../app/api.py", line 15, in <module>
from app.models import (
File ".../app/models.py", line 44, in <module>
class RecordDataResponse(BaseModel):
File ".../.venv/lib/python3.9/site-packages/pydantic/main.py", line 212, in __new__
fields[ann_name] = Field.infer(
File ".../.venv/lib/python3.9/site-packages/pydantic/fields.py", line 145, in infer
return cls(
File ".../.venv/lib/python3.9/site-packages/pydantic/fields.py", line 122, in __init__
self.prepare()
File ".../.venv/lib/python3.9/site-packages/pydantic/fields.py", line 187, in prepare
self._populate_sub_fields()
File ".../.venv/lib/python3.9/site-packages/pydantic/fields.py", line 243, in _populate_sub_fields
self.type_ = self.type_.__args__[0] # type: ignore
File "/usr/lib/python3.9/typing.py", line 706, in __getattr__
raise AttributeError(attr)
AttributeError: __args__