I have issues when I try to run the generated code from external modules.
I have generated Python classes using subclass, so I have a model.py and a model_subs.py files. From my external code I can reach models_subs but from it I cannot reach model.py, so something is happening with the interpreter path.
I am able to workaround it by applying in models_subs the following statement: sys.path.append(os.path.abspath(__file__ + "/.."))
I place it before the import models as supermod, and everything works good.
Is there a way to instruct cli to do it automatically?
Hello,
I have issues when I try to run the generated code from external modules.
I have generated Python classes using subclass, so I have a
model.py
and amodel_subs.py
files. From my external code I can reachmodels_subs
but from it I cannot reachmodel.py
, so something is happening with the interpreter path.I am able to workaround it by applying in
models_subs
the following statement:sys.path.append(os.path.abspath(__file__ + "/.."))
I place it before the
import models as supermod
, and everything works good.Is there a way to instruct cli to do it automatically?
I am attaching an screenshot on how it does look.
Thank you!
Forgot to mention: I have added an
__init__.py
file in the same directory as the models.