Minor annoyance re: local vs deployed Why, locall...
# ask-community
d
Minor annoyance re: local vs deployed Why, locally, can I use the module import using
from .assets import lead_assets
, but in my user deployment I have to use the full path (i.e.
from foo.sales.assets import lead_assets
This is the error I get
Copy code
ImportError: attempted relative import with no known parent package
I see most examples using the dot notation, but I’m struggling in making this work while deployed (and I’d like to keep local vs deployed consistant) Dagster is deployed to K8s via Helm Chart. Much thanks!
z
I've ran into similar problems before. Maybe someone more knowledgable on python packaging can shed light on the specifics, but usually it has to do with a combination of how your code is set up in your container (installed from a wheel vs. just copied into a folder) and where the code is being executed from. I've ran into the problem enough times (outside of Dagster too) that I just always use the full path now. I also feel that relative imports are too implicit and unnecessarily hide the package structure for the sake of convenience, but that's just an opinion.
c
might have something to do with the way you're loading the repository; are you specifying the path via module scope?
d
Hey Chris, I am loading the repo by specifying in the Helm chart user deployment
z
Hey yall, any update here? We are running into the exact same issue
d
We just ended up using the full paths
z
Got it, mind sharing how you got that working locally?