So my project structure is the following:
project/
src/
__init__.py
utils.py
model.py
usage.py
I now want to import functions from utils.py and a class in model.py into my usage.py. But the model.py itself imports functions from utils.py.
So I am doing the following:
# usage.py
from src.model import Model
from src.utils import onehot_to_string
But I am getting the error that it couldnt import functions from utils.py into the model.py:
File "usage.py", line 11, in <module>
from src.model import *
File "/project/src/model.py", line 7, in <module>
from utils import onehot_to_string
ImportError: cannot import name 'onehot_to_string' from 'utils' (/lib/python3.7/site-packages/utils/__init__.py)
I think I am lacking of some basic Python packaging knowledge here. Can someone help me out? :)