Hey team - how does the --install-policy if-not-pr...
# prefect-cloud
m
Hey team - how does the --install-policy if-not-present pull in the proper versions? We have an ECS worker running
Copy code
prefect worker start -t ecs -p ecs-worker-pool --install-policy if-not-present
Copy code
Warning! Failed to load collection 'prefect_aws': ImportError: cannot import name 'deprecated_class' from 'prefect._internal.compatibility.deprecated' (/usr/local/lib/python3.10/site-packages/prefect/_internal/compatibility/deprecated.py)
a
@alex — do you have any insight here?
m
Our worker is using
prefecthq/prefect:2.14.13-python3.10
as the default image
k
I've seen this before
this happens when prefect tries to install a version of an integration package that requires a newer version of prefect than the one that's currently running
I'd do this instead:
pip install prefect-aws && prefect worker start -t ecs -p ecs-worker-pool
note that this will upgrade prefect during the integration install, so if you need a specific version of prefect for your worker, you'll want to manually select an integration version that's compatible
a
#caption "Kevin enters the chat" thor
😆 1
m
Is there an updated image that will work with the updated prefect aws? I'm not sure I understand how
pip install prefect-aws && prefect worker start -t ecs -p ecs-worker-pool
would resolve the issue. The install policy should install all proper requirements and version right?
k
kind of. when prefect tries to install prefect-aws at worker start time, prefect is already running, so despite upgrading itself, the version that's trying to start the worker is still the old version 😵‍💫. if you're cool with using a different image, the newest image will install a worker's dependencies just fine with your original command
prefecthq/prefect:2.17.1-python3.10
I believe is the newest
👍 1
m
The
pip install prefect-aws && prefect worker start -t ecs -p ecs-worker-pool
seems to be stable for us. Thanks for the help Kevin - much appreciated!
🙌 1