ihsrobotics/ihsboost

Issue with installation of python bindings

Closed this issue · 1 comments

Description

After installing version 1.8.3 following the instructions on a new wombat with the custom OS, ihs_bindings cannot be imported because the python interpreter cannot find the file 'libihsboost.so'.

To Reproduce

git clone https://github.com/ihsrobotics/ihsboost.git
cd ihsboost
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make
sudo make install

Testing the import in python3

>>> import ihs_bindings
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: libihsboost.so: cannot open shared object file: No such file or directory

Details

Running the command cd / && sudo fine -name libihsboost.so, it found the following locations:

./home/pi/Documents/ihsboost/build/libihsboost.so
./usr/local/lib/libihsboost.so

Retrying the installation and manually specifying the build bindings option to true did not fix the issue.
On a wombat with working ihs_bindings (this is from the pre-installed ihsboost on the custom OS), running ihs_bindings.__file__ reveals the following file:

/usr/local/lib/python3.9/dist-packages/ihs_bindings.cpython-39-aarch64-linux-gnu.so

Inside the python3.9 dist packages directory, there are 3 items:

ihs_bindings.cpython-39-aarch64-linux-gnu.so  
ihs_bindings.pyi  
ihs_communicate.cpython-39-aarch64-linux-gnu.so

However, on the faulty installation, the directory is empty.

After copying all the files from the dist packages of the working wombat to the faulty wombat, the error persists.

Build and configure logs would be helpful!
Also, you are correct that the bindings file is different from libihsboost.so. This is what is required for interfacing with Python, and you can see more about how the bindings are built in the modules/bindings/CMakeLists.txt file.

As for your issue, it would appear that the installation was successful since you were able to get that error. If the installation had failed, you would get an error like "ModuleNotFoundError: No module named ihs_bindings" However, since you are getting an ImportError for a .so file, this suggests that your installation of the python bindings is successful. Try running sudo ldconfig or manually updating your PATH variable if the installation directory wasn't on your PATH.