I am trying to run docker containers child1 and child2. lets say we have:
UPDATED
|parent
|-----|child1/
src_folder/
__init__.py
mod1.py
|-----|child2/
__init__.py
symlink_target_folder
mody.py
test1_dir/
smfile.py
I have done something like
ln -rs ~/parent/child1/src_folder ~/parent/child2/symlink_target_folder
In mody.py When I do,
from symlink_target_folder import mod1
it works;
but from test1_dir>smfile.py when I do
from .child2.symlink_target_folder import mod1
it throws back ImportError.
I want to know how could I access the same module from that directory ? Could exporting symlink_target_folder to PYTHONPATH someway work it out. I have done
export PYTHONPATH=$PYTHONPATH:/symlink_target_folder
such that ` I can do from mody.py
from symlink_target_folder.mod1 import SmFoo
but I dont think its due to PYTHONPATH. just that symlink_target_folder and mody.py are in same folder.
How do I solve this? What would be a better way to approach this problem? I did check this out