FastAPI & Gradio Versioning: 'FieldInfo' object has no attribute 'in_'

I’ve had a gradio interfaces running smoothly for a bit. Today I tried launching it and got this error:

fastapi/dependencies/, in add_param_to_fields(field, dependant)
460 def add_param_to_fields(*, field: ModelField, dependant: Dependant) → None:
461 field_info = cast(params.Param, field.field_info)
→ 462 if field_info.in_ == params.ParamTypes.path:
463 dependant.path_params.append(field)
464 elif field_info.in_ == params.ParamTypes.query:

Does anyone have any suggestions for versioning that may fix this? I’ve tried many, many combinations.

AttributeError: ‘FieldInfo’ object has no attribute 'in_


Resolved, thanks for patch

Could you please let us know how you resolved this?

I did not change anything, I just ran it the next day and it launched. These were my installations:

%pip install fastapi --upgrade
%pip install pydantic --upgrade
%pip install gradio --use-deprecated=legacy-resolver

If you have pydantic version 2.0 or above you must have gradio version 3.36.0 or above

I was using 3.36.1 originally and getting this same error. It seemed like it was an issue under the hood, but I could be wrong. I hope everyone else having this issue figures it out :smiley: