Код: Выделить всё
parentfolder/gfolder/codefolder/fileA.py
parentfolder/gfolder/utilfolder/util.py
< /code>
gfolder
Я пытаюсь сделать в filea.py:
Код: Выделить всё
import gfolder.utilfolder.util as util
< /code>
I also tried adding before the import statement:
sys.path.append(".../parentfolder/")
< /code>
And that didn't work either:
import gfolder.utilfolder.util as util
ModuleNotFoundError: No module named 'gfolder'
< /code>
The solution in a similar question says to include __init.py__
Подробнее здесь: https://stackoverflow.com/questions/486 ... ing-folder