PYTHONPATH is not working in ECS Task block

Hi :raised_hand:

I am trying to import my custom module called datetime_consts, but getting a “module not found” error.

The datetime_consts file is located here:

CleanShot 2023-05-01 at 17.35.18@2x

The flow is deployed as an ECS Task Block and defined with PYTHONPATH so that the Python interpreter will also look inside the “utils” folder for custom modules.

When looking at the runtime logs it seems that the “utils” folder is in fact included in the sys.path and the interpreter should find it:

When running the same flow locally, and seeing ‘/opt/prefect/utils’ in the sys.path everything works great.
It’s as if when the flow runs inside the ECS task, the ‘/opt/prefect/utils’ is ignored.

Any help on the issue would be much appreciated :pray: