Basil V
10/13/2020, 8:19 PMModuleNotFoundError: No module named '<my_module>'
error when I try to run Dagit. I recently upgraded my project to use the workspace.yaml
structure. I can provide more details but does anyone have an idea what may be causing the issue?daniel
10/13/2020, 8:23 PMBasil V
10/13/2020, 8:24 PMtop_level_project_folder
my_module
__init__.py
repo.py
workspace.yaml
and my workspace.yaml file contains:
load_from:
- python_module:
module_name: my_module.repo
attribute: my_repository
I'm running dagit
from the same directory as workspace.yaml
. I've tried importing/running find_packages
from setuptools
in the same directory and my_module
shows up.my_repository
is a function in my_module/repo.py decorated with @repositorypython_module
and python_package
used in the workspace.yaml
file—which one is correct? (currently tried both and getting same error)dagit
from inside a pipenv shellalex
10/13/2020, 8:32 PMworkspace.yaml
so since you depend on working directory to load the module, you may be best off using python_file
instead of python_module
prha
10/13/2020, 8:33 PMpython_package
and python_module
expect the specified package to be installedBasil V
10/13/2020, 8:36 PMpython_file
I get this error:
ImportError: `attempted relative import with no known parent package` while importing module repo from file /path/to/my_module/repo.py. Consider using the module-based options `-m` for CLI-based targets or the `python_package` workspace.yaml target.
workspace.yaml
in this case:
load_from:
- python_file:
relative_path: my_module/repo.py
attribute: my_repository
I don't understand where I'm going wrong I feel like I've paralleled the examples in your docs pretty closely.prha
10/13/2020, 8:44 PMBasil V
10/13/2020, 8:47 PMrepository.yaml
file workflowprha
10/13/2020, 8:49 PMpip install -e path/to/module
to do an editable install for local developmentattempted relative import with no known parent package
errorsBasil V
10/13/2020, 8:52 PMpipenv install -e path/to/module
so I have my own module as a dependency for my project? How does that translate when I move things to production?prha
10/13/2020, 8:53 PM0.10.0
to resolve these headaches, but any change to code loading results in some breaking changes so we’re reluctant to do that in one of the weekly releases.Basil V
10/13/2020, 8:59 PM0.10.0
Thanks!