I got the following error when I compiled as followed. Why the errors? Thanks in advance.
cd /root/rel_path/ctlib/src
python3 main_prog.py
Error:
root@Linux:~/rel_path/ctlib/src# python3 main_prog.py
Traceback (most recent call last):
File "main_prog.py", line 1, in <module>
from ctlib.auto import CtAuto
ModuleNotFoundError: No module named 'ctlib'
root@Linux:~/rel_path/ctlib/src
Example path tree:
/root/rel_path/
|--- ctlib
|--- src
|--- main_prog.py
|--- auto
|--- __init__.py
Code:
main_prog.py code:
from ctlib.auto import CtAuto
print("hello")
init.py code:
#!/usr/bin/env python3
class CtAuto:
def print_hello(self):
print("Hello, from CtAuto")