I want to create the following module and object structure:
main_module
|
`--sub_module
|
+--ObjectOne
|
`--sub_sub_module
|
`--ObjectTwo
When I only had main_module.sub_module
everything worked as it should, as I created an empty __init__.py
inside the main_module
folder (since main_module
does not have any objects at the moment), and I placed sub_module.so
next to it.
However, when I tried to create two separate c modules to make main_module.sub_module.sub_sub_module
work (that is sub_module.so
and sub_sub_module.so
) and then I added two __init__.py
s which both of them imported their extension modules relative to them, then I got into ImportError
s (as wrappers around the undefined symbol
error "raised" from the shared libraries), because sub_sub_module
needs a few of the C-level definitions from sub_module
. Which makes me think, it would be way more easier, to create a single shared library which somehow creates "virtual" modules inside it, instead of the unnecessary library linking..
So my question is: Is it possible? If so, how? Or, is there a better way to achieve what I'm looking for?