Here is a step-by-step solution:
Add a script called run.py
in /home/bodacydo/work/project
and edit it like this:
import programs.my_python_program programs.my_python_program.main()
(replace main()
with your equivalent method in my_python_program
.)
/home/bodacydo/work/project
run.py
Explanation:
Since python appends to PYTHONPATH the path of the script from which it runs, running run.py
will append /home/bodacydo/work/project
. And voilĂ , import foo.tasks
will be found.