I have a file structure like this.
.
└── E:\test
├
├── M2
│ └── demo.py
|
│
└── MA
│ └── MA1
│ │ ├── __init__.py
│ │ │
│ │ └── ma1.py
│ │__ __init__.py
ma1.py
def foo():
print("I am here")
demo.py
from MA.MA1.ma1 import foo
print(foo())
I am use python3.8 and win10 system.
In cmd I try to cd test directory and python .\M2\demo.py, it show error?
PS E:\test> python .\M2\demo.py
Traceback (most recent call last):
File ".\M2\demo.py", line 1, in <module>
from MA.MA1.ma1 import foo
ModuleNotFoundError: No module named 'MA'