Catalog Builder Tool -'src' not found
nishsilva opened this issue · 4 comments
I am trying to use the catalog builder tool in the MDTF framework to generate a data catalog for a 4th generation POD. When I run the tool following the instructions it returns aModuleNotFoundError
indicating that 'src' module is not available.
I confirmed that the directory have the expected structure to call 'src'.
Could someone take a look into this?
Thanks,
Nish
> (_MDTF_base) netige@crhtc53:/glade/work/netige/mdtf_Apr24_2/mdtf/MDTF-diagnostics/tools/catalog_builder> python3 catalog_builder.py --config zos_builder_config.yml
> Traceback (most recent call last):
> File "/glade/work/netige/mdtf_Apr24_2/mdtf/MDTF-diagnostics/tools/catalog_builder/catalog_builder.py", line 25, in <module>
> from src.util import json_utils, basic
> ModuleNotFoundError: No module named 'src'
@nishsilva The import issue should be fixed. Please merge the main branch updates into your fork and try the catalog builder again.
@wrongkindofdoctor I updated the fork and tried the catalog builder after pulling the updates. But the issue still exists for me.
> (_MDTF_base) netige@crhtc53:/glade/work/netige/mdtf_Apr24_2/mdtf/MDTF-diagnostics/tools/catalog_builder> python3 catalog_builder.py --config /glade/work/netige/mdtf_Apr24_2/data_catalogs/zos_builder_config.yml
> Traceback (most recent call last):
> File "/glade/work/netige/mdtf_Apr24_2/mdtf/MDTF-diagnostics/tools/catalog_builder/catalog_builder.py", line 34, in <module>
> from src import util
> ModuleNotFoundError: No module named 'src'
@nishsilva As a workaround, try commenting out the import line, and the following code block (lines 127--137):
try:
json_config = util.json_utils.read_json(gfdl_fieldlist, log=_log)
except IOError:
print("Unable to open file", gfdl_fieldlist)
sys.exit(1)
gfdl_info = util.basic.NameSpace.fromDict(json_config)
if hasattr(gfdl_info.variables, variable_id):
var_metadata = gfdl_info.variables.get(variable_id)
else:
raise KeyError(f'{variable_id} not found in {gfdl_fieldlist}')
Only the GFDL builder needs the util modules, so you should be okay if you are creating a CMIP or CESM dataset.
@wrongkindofdoctor Thank you for this, Jess. This worked out! Closing the issue.