I'm newbie on python so please understand me if this question is too easy. I already searched out but I didn't understand accurately their answers.
My question : What point I missed out for understanding python import system?
My project structure is like this (https://github.com/dingyo777/python_import_test):
-- python_import_test
|-- deco
| |-- printer.py
| |-- decorator.py
|
|-- test.py
- printer.py imports decorater.py
- test.py imports printer.py
When I run python test.py
, error is like this
Traceback (most recent call last):
File "test.py", line 5, in <module>
import deco.printer
File "/Users/dingyo/Projects/my_repo/python_import_test/deco/printer.py", line 3, in <module>
import decorator
ModuleNotFoundError: No module named 'decorator'
Of course, it will be helpful if someone tell me how to resolve this error. But more thing what I want to know is understanding how python import package or module accurately.
Would you mind to explain what point I missed out?