https://prefect.io logo
Title
y

Yousef Hosny

08/30/2022, 1:47 AM
Hi all! Does anyone know why
deployment.apply()
doesn't work from a jupyter notebook cell, but does work from
.py
script file. Also, is there anyway to deploy a flow to prefect cloud using jupyter notebook ?
1
j

José Duarte

08/30/2022, 8:38 AM
Have you tried
await deployment.apply()
?
1
y

Yousef Hosny

08/30/2022, 9:09 AM
Same issue unfortunately
j

José Duarte

08/30/2022, 9:24 AM
await (await deployment).apply()
👍 1
:thank-you: 1
Both
build_from_flow
and
apply
are async function (and also sync due to a decorator they have, the issue might be there
y

Yousef Hosny

08/30/2022, 9:51 AM
That seems to have fixed it, but another issue now rises, It seems like the getattr(module, "__file__") doesn't work with jupyter notebooks as they are not considered "modules"_
j

José Duarte

08/30/2022, 9:53 AM
That would by because (AFAIK) in simple terms, Jupyter is running on top of an IPython session which doesn’t “count” as a file
y

Yousef Hosny

08/30/2022, 9:55 AM
That makes sense.. anyways thank you a lot Jose for your help, that's really appreciated
j

Jeff Hale

08/30/2022, 11:56 AM
You can track this issue and see discussion here. Feel free to leave a comment or emoji reaction at the GitHub issue.
2