I'm trying to create a deployment for Prefect Clou...
# prefect-community
k
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
Thanks @Kevin Grismore this helped me too. However, out of curiosity - how do I solve that with a yaml deployment? @Anna Geller
a
I'd recommend checking the latest deployment docs, dunno off the top of my head
n
I didn’t check it yet, but I guess defining the PYTHONPATH before execution, should solve the issue
a
That's a valid approach for sure