```Task run failed with exception: ImportError("ca...
# ask-community
a
Copy code
Task run failed with exception: ImportError("cannot import name 'SecretField' from 'pydantic' (/usr/local/lib/python3.11/site-packages/pydantic/__init__.py)") - No retries configured for this task.
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/prefect/task_engine.py", line 857, in run_context
    yield self
  File "/usr/local/lib/python3.11/site-packages/prefect/task_engine.py", line 1487, in run_task_sync
    engine.call_task_fn(txn)
  File "/usr/local/lib/python3.11/site-packages/prefect/task_engine.py", line 874, in call_task_fn
    result = call_with_parameters(self.task.fn, parameters)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/prefect/utilities/callables.py", line 210, in call_with_parameters
    return fn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^
  File "/opt/prefect/prefect-requirements/ETL/test_flow/test_etl.py", line 6, in test_packages
    from prefect_dbt import PrefectDbtRunner
  File "/usr/local/lib/python3.11/site-packages/prefect_dbt/__init__.py", line 4, in <module>
    from .cli import (  # noqa
  File "/usr/local/lib/python3.11/site-packages/prefect_dbt/cli/__init__.py", line 1, in <module>
    from .credentials import DbtCliProfile  # noqa
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/prefect_dbt/cli/credentials.py", line 6, in <module>
    from prefect_dbt.cli.configs import GlobalConfigs, TargetConfigs
  File "/usr/local/lib/python3.11/site-packages/prefect_dbt/cli/configs/__init__.py", line 1, in <module>
    from .base import TargetConfigs, GlobalConfigs, MissingExtrasRequireError  # noqa
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/prefect_dbt/cli/configs/base.py", line 7, in <module>
    from pydantic import BaseModel, Field, SecretField
ImportError: cannot import name 'SecretField' from 'pydantic' (/usr/local/lib/python3.11/site-packages/pydantic/__init__.py)
i got this error when i try to import prefect_dbt, i think prefect_dbt and prefect 3 for library pydantic dont have same version, but im not sure
n
hi @adam aditama - can you share what
prefect version
shows when you encounter this error?
a
Sure @Nate, prefect 3.4.13
👍 1
n
prefect version
would also include the
prefect-dbt
version and
pydantic
version, could you share those as well?
a
Ooh its include when i try to install prefect? I try to install prefect-dbt > 0.7.0 and pydantic >= 2.10.1, Sorry istill on my way home, but when i arrive i will share the spesific version,
n
no worries, where you’re back the output of the
prefect version
CLI command is the most useful thing to share