Eric Sexton
02/06/2024, 6:18 PMMarvin
02/06/2024, 6:18 PMSecretField
issue specifically arises because Pydantic removed or altered this attribute in their 2.0 release, and Prefect's code has not been adapted to accommodate these changes at the moment you've encountered the error.
To resolve this error:
1. Ensure you are using a compatible version of Pydantic that works with your current version of Prefect, which would be Pydantic 1.10.x or lower.
2. Update your Python environment to use the correct version of Pydantic by specifying the version in your package manager (e.g., pip, poetry).
If using pip, you can run:
bash
pip install 'pydantic<2.0'
If using poetry, you can specify the version in your pyproject.toml
file:
toml
[tool.poetry.dependencies]
pydantic = "<2.0"
And then run:
bash
poetry update
Doing this should resolve the ImportError you are experiencing. Be aware that Prefect may update their codebase in the future to be compatible with later versions of Pydantic, so keep an eye on Prefect's change logs or GitHub issues for such updates.