Hello, I hope this is the right place to ask for h...
# ask-community
b
Hello, I hope this is the right place to ask for help but if not please let me know. I've been working on getting Prefect Cloud set up on AWS and things are going quite well. I've hit a snag that I can't seem to resolve. I'm getting
Failed to load and execute Flow's environment: ModuleNotFoundError("No module named 'xxx'")
when submitting the flow to and ECS(Fargate). The module in question is a custom Python module that I include in the agent Docker image and it's installed via pip install. I feel like I'm missing something here but from what I've read, that should work. Does anyone have a tip on how I might get the flow execution to be aware of this custom module? Is the Agent the proper place to install the module?
k
Hey @Brian S, this is the right place. The agent is not the right place. You attempt is good. Can you show me your Dockerfile? Can you download the image and exec into it and start an interaction python shell then try to import it? Try in different directories to see if installation was right.
I have a guide here . May help or you may be past this. Would be good for double checking though
b
awesome, let me check the guide and make sure I'm doing this correctly
You mention the Agent container isn't the correct place for that so I'm pretty sure that's my first problem hehe
k
Well because ECS execution environment is different
b
I see the err of my ways. This document seems to have the answer.
t
@Brian S Add this line to your docker file (if you are not using setup.py)
ENV PYTHONPATH "${PYTHONPATH}:/app"
@Kevin Kho is really trying to hide the magic line that fixed my deployment issue . (I had the same error)
k
pip install should be sufficient though
b
Thanks so much guys! I'm pretty much over the hump thanks to you
👍 1