I have an app:
/app
/folder1/file_one.py
/folder2/file_two.py
/folder3/file_three.py
PYTHONPATH ~/app
When I try to import function1
from file_one.py
to file_two.py
everything works correctly, but when I try:
import function1 from file_one.py to file_three.py I get the message:
Traceback (most recent call last):
File "/home/ubuntu18/rex/app/folder3/file_three.py", line 1, in <module>
from folder1.file_one import function1
ModuleNotFoundError: No module named 'folder1'
This problem occurs all the time, and I always solve it in different ways, but nothing works right now. I tried:
-PYTHONPATH
-relative and absolute path
-__init.py__