I have a folder structure below
my_project
-- main.py
-- dept_1
-- process.py
-- ops.py
-- dept_2
-- process.py
-- ops.py
-- common
-- utils.py
-- config.py
-- meta_data.py
Now I have 2 decorators defined in utils.py
. Now I want to use those inside ops.py
which is again called from process.py
.
I have used the following code.
in process.py
from dept_1 import ops.py
from common import utils
# to import some other functions
in ops.py
I have used all the below options
from common import utils
from common.utils import *
from common.utils import decorator_1, decorator_2
but every time, I face some import error, saying either
ImportError: No Module named 'utils'
or
utils has no attribute 'decorator_1
or
ImportError: can not import name 'decorator_1'
How to solve this issue?