I am having an issue importing a file that imports other files. My folder structure looks as follows:
Folder Structure:
proj/
src/
main_script.py
some_module/
module-file.py
helper_a.py
helper_b.py
helper_c.py
Each of the files contain this
proj/src/main_script.py:
import module_file as mf
proj/src/some_module/module_file.py:
import helper_a
import helper_b
import helper_c
When I run main_script.py
, the import of module_file.py
fails with the following error:
ModuleNotFoundError: No module named 'helper_a'
If I were to set some_module
as my working directory, this wouldn't be an issue, but the relative paths aren't working from the src directory. I tried adding a __init__.py
file to the some_module
folder, but that didn't affect the outcome. Any insight on how this is supposed to work would be appreciated.