I am working on a project in python (First project). I am having a very hard time with importing between files.
My structure is as follow:
backend/
├── app/
│ ├── services1/
│ │ ├── __init__.py
│ │ └── file1.py
│ ├── services2/
│ │ ├── __init__.py
│ │ └── file2.py
│ └── __init__.py
└── ...
I am trying to import my function from file 1 to file 2. I am running file 2 in vscode. Both packages have init.py
The error:
ModuleNotFoundError: No module named 'app.services1.file1'
I’ve tried:
from app.services1.file1 import function
I am running the file2 from vscode and im in the backend directory.