Alon Barad

05/09/2023, 10:19 AM
Hey, I'm trying to execute my deployment but keep getting an import error
File "/Users/barad/Desktop/Code/prefect/venv/lib/python3.11/site-packages/prefect/utilities/", line 164, in load_script_as_module
    raise ScriptError(user_exc=exc, path=path) from exc
prefect.exceptions.ScriptError: Script at '' encountered an exception: ModuleNotFoundError("No module named 'common'")
How can I change the working directory?

Miguel Moncada

05/09/2023, 10:25 AM
Hey @Alon Barad you can do something similar to what it's done in this template
TL;DR the deployment is defined within the Python package (in my case named
) but called from the root of the repository from the
This script is being ran from GitHub actions in this case, so whenever the flow or the deployment is modified, the script is called with the corresponding file name.
I'd also recommend reviewing the python package structure in general. I haven't checked it exhaustively but you might encounter dependency import issues as it is

Alon Barad

05/09/2023, 10:49 AM
Ill check Thanks!