helloPython
__init__.py
myutil
__init__.py
mymaths.py
service
__init__.py
cal.py
mymaths.py
def myadd(a, b):
return a+b
cal.py
from ..myutil import mymaths #or any other similar import statement
sum = mymaths.myadd(3, 4)
Here, in cal.py, I want to use a method defined in mymaths.py as above However when I try to import, I get below error, when I "Run Python file in terminal" in VSCode Tried multiple ways
First method
from ..myutil import mymaths
ImportError: attempted relative import with no known parent package
Second method
from helloPython.myutil import mymaths
ModuleNotFoundError: No module named 'helloPython'