0
votes

I'm trying to use a recorded case in OpenMDAO contained in "my_file.db"

when i execute the following code:

    import openmdao.api as om
    cr = om.CaseReader('my_file.db')

I get the following error:

ModuleNotFoundError: No module named 'groups'

'groups' is a folder from the openMDAO code that I used to record the case and now I'm trying to import it from a different directory. How can I redefine the path for om.CaseReader to look for the modules it needs?

2

2 Answers

0
votes

Solved using:

import os
dirname = os.path.dirname(__file__)
import sys
sys.path.append( dirname )