记录报错及解决方案[TypeError: dataclass_transform() got an unexpected keyword argument ‘field_specifiers‘]

记录python在使用fastapi时的报错解决

      • 1.现象
      • 2.解决方案

1.现象

下面时报错代码

  File "pydantic\dataclasses.py", line 46, in init pydantic.dataclasses
    # +---------+-----------------------------------------+
  File "pydantic\main.py", line 121, in init pydantic.main
TypeError: dataclass_transform() got an unexpected keyword argument 'field_specifiers'

2.解决方案

pip install --upgrade pydantic

你可能感兴趣的:(python)