https://prefect.io logo
#prefect-community
Title
# prefect-community
k

Kevin Grismore

07/13/2022, 3:35 PM
I'm trying to create a deployment for Prefect Cloud 2.0 for a flow that imports a local package named
tutorial
that's in the flow's directory, and when I run
prefect deployment create deployment.py
I get
ModuleNotFoundError: No module named 'tutorial'
1
My flow, deployment, and package are set up like this
and my flow uses this import:
from tutorial.spiders.quotes_spider import QuotesSpider
simply running the flow by itself works fine, though
my assumption is that there is an expectation that the flow script should be able to run only with what's available in the env and local imports aren't going to be picked up, but I wanted to be sure I wasn't missing anything
nevermind, I solved it by creating the deployment in the deployment script with
Deployment().create()
instead
🙌 2
n

Noam Cohen

07/16/2022, 6:02 PM
Thanks @Kevin Grismore this helped me too. However, out of curiosity - how do I solve that with a yaml deployment? @Anna Geller
a

Anna Geller

07/17/2022, 11:07 AM
I'd recommend checking the latest deployment docs, dunno off the top of my head
n

Noam Cohen

07/17/2022, 2:24 PM
I didn’t check it yet, but I guess defining the PYTHONPATH before execution, should solve the issue
a

Anna Geller

07/17/2022, 4:06 PM
That's a valid approach for sure
5 Views