<@ULVA73B9P> In Prefect 2.x what could be the caus...
# ask-marvin
y
@Marvin In Prefect 2.x what could be the cause of the following error:
Copy code
Warning!  Failed to load collection 'prefect_gcp': ImportError: cannot import name 'SecretDict' from 'prefect.types' (/usr/local/lib/python3.9/site-packages/prefect/types/__init__.py)
1
m
grug see you have problem with
prefect_gcp
import because
SecretDict
missing from
prefect.types
. let grug find reason for you. Grug find error might be because
SecretDict
moved or renamed. 1. Prefect docs mention
SecretDict
for obfuscating sensitive data in logs. But maybe Prefect change structure or name. 2. No relevant GitHub issues found. Grug suggest: 1. Check Prefect version compatibility for
prefect_gcp
. 2. Reference Prefect or
prefect_gcp
changelog and update code to match new naming or structure. More info: - Prefect Integration - Prefect Block Types
y
The issue was that I used the following command for starting the worker:
Copy code
prefect worker start --install-policy always
I resolved this by running the following instead:
Copy code
prefect worker start --install-policy if-not-present
I have a custom
requirements.txt
and the
always
tried to install the newest version of
prefect-gcp
which is not compatible.