Код: Выделить всё
Project_root (folder)
source (folder)
main.py
functions(folder)
test.py
__init__.py (empty)
Код: Выделить всё
import os
import sys
from source.functions import test
test.hello()
Код: Выделить всё
def hello():
print("Hello World!")
Я получаю следующую ошибку:
Код: Выделить всё
line 4, in
from source.functions import test
ModuleNotFoundError: No module named 'source'
Подробнее здесь: https://stackoverflow.com/questions/786 ... as-main-py