<@ULVA73B9P> I recently updated to Prefect 3.0 and...
# ask-marvin
s
@Marvin I recently updated to Prefect 3.0 and now I get this error when I try to run a flow:`ImportError: cannot import name 'RootModel' from 'pydantic'` what is this about?
m
The error you encountered (
ImportError: cannot import name 'RootModel' from 'pydantic'
) is related to changes in the underlying version of Pydantic used in Prefect 3.0. Prefect 3.0 has upgraded to Pydantic 2.0, which involves some breaking changes, including the removal or renaming of certain models and attributes. The
RootModel
class is part of these changes. Here are some steps you can take to resolve this issue: 1. Update Pydantic Models: If you are using custom Pydantic models, you will need to make sure they are compatible with Pydantic 2. You can refer to the Pydantic v2 upgrade guide for detailed instructions on the necessary changes. 2. Check Imports: Verify that your imports are compatible with the new structure and naming conventions in Pydantic 2.0. You may need to adjust any custom serializers or settings that rely on Pydantic models. For a detailed guide on upgrading to Prefect 3.0 and notes on Pydantic changes, you can visit this link: https://docs-3.prefect.io/3.0/resources/upgrade-to-prefect-3. If you still face issues, it could be useful to review the exact lines of code where the import is failing and compare them against the new Pydantic 2.0 documentation. Feel free to reach out if you need further assistance!