I have looked into other similar posts, but could not find an answer.
So,
Here is the structure of the project I am working on:
lyrics/__init__.py
lyrics/functions.py
manifold.py
When I execute manifold.py with this command:
./manifold.py
it calls:
import lyrics as lyr
which in turn calls init.py, which calls:
from lyrics import *
import functions
Here is the error that I get:
Traceback (most recent call last):
File "./manifold.py", line 20, in <module>
import lyrics as lyr
File "/g../__init__.py", line 2, in <module>
import functions
ModuleNotFoundError: No module named 'functions'
Any idea where the error comes from ?
Thanks
>Solution :
If you want to import relatively, you have to add the . before functions, i.e. from . import functions
The import there works similar to unix: The single dot is for the current directory. If you put two dots (..) you go up one level, three dots (...) goes up two levels and so on.
If you want to go absolute, then from lyrics import functions should work.