Directory Structure:
| Packages
| noobpy
| __init__.py
| linalg.py
| main.py
linalg.py:
def inv():
print("inv called")
main.py :
import noobpy as np
np.linalg.inv()
In __init__.py:
when I use:
import linalg
It throws in the error that "No module named 'linalg'", when running main.py
but when I use:
from . import linalg
inside of _init_ ,it works just fine, even though I can call linalg.inv inside of _init_ in both the cases.