I've got a local project structure that looks something like this:
local_root/
├─ reusable_code/
│ ├─ helpers.py
├─ main/
│ ├─ script.py
Inside of script.py, I have the statement from reusable_code import helpers
. When I'm working from my local tree (which happens to be in a parallel directory to the actual project), this works just fine and there are no issues.
However, when I push to the 'live' repo, which of course has a structure identical to this, script.py always fails to run because it "can't find any module 'reusable_code'". I've tried running the live version of script.py from the command line and from task scheduler, and even tried using the python executable located in my local project's venv to run the live version of script.py, but it still won't run.
I've also tried appending the absolute path to the reusable_code
directory using sys.path.append(<path>/reusable_code)
, but that didn't work either. Any further suggestions on how to go about fixing this?
Thanks to all in advance!