I'm using folder structure like this:
program
program/app/app.py
program/app/lib.so
program/app/py_interfaces.so
program/launcher.py
I have compiled python interfaces py_interaces.so
with boost.python linking to ./lib.so
, so it would load library from the same folder as interfaces.
I'm importing interfaces in app.py
:
import py_interfaces
and if I run app.py
it works fine. But I need to run from launcher/py
and when I do that, I get error:
Import Error: ./lib.so: cannot open shared object file: no such file or directory.
I guess it loads py_interfaces.so
fine, but it searches for lib.so
in wrong folder: program
. Would it be possible to force it to do it correctly? Should I link differently? I dont' want to change working directory (I need other files from root program
directory)