Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: libaruco.so.3.0: cannot open shared object file: No such file or directory #17

Closed
mingliangfu opened this issue Jan 3, 2018 · 5 comments

Comments

@mingliangfu
Copy link

I am running an Ubuntu 16.04 machine with python 3.6.4, Anaconda 5.0.1. A virtual environment named py36 was created with Anaconda for my project. I have completed the installation following the Installation Python3 (experimental). In order to accommodate the system environment, setup.py was edited as follows:

from distutils.core import setup, Extension
sourcefiles = ['aruco_wrap.cxx']
aruco_module = Extension('_aruco',
sources=sourcefiles,
language="c++",
extra_compile_args=["-std=c++11", "-Wall", "-fopenmp", "-Wunused-variable"],
include_dirs=["/usr/local/include/opencv2", "/home/*/anaconda3/envs/py36/include/eigen3", "."],
libraries=["opencv_core", "opencv_imgproc", "opencv_calib3d", "opencv_highgui", "aruco"],
library_dirs=["/usr/local/lib","/home/*/programs/aruco304/install/lib","/home/*/anaconda3/envs/py36/lib"])

setup(name='aruco', version='3.0', author="""ArUco: Rafael Muñoz Salinas, Python wrappers: Marcus Degenkolbe""", description="""ArUco Python wrappers""", ext_modules=[aruco_module], py_modules=["aruco"], )

After the installation, the corresponding .so and .py files (titled as _aruco.cpython-36m-x86_64-linux-gnu.so and aruco.py) were generated in the path--/home/*/anaconda3/envs/py36/lib/python3.6/site-packages. When the program was acitvated, an issue appeared:
ImportError: libaruco.so.3.0: cannot open shared object file: No such file or directory

In fact, no file named as libaruco.so.3.0 was generated during the installation. I tried to make a link file by ln -s path/to/virtual/environment/_aruco.cpython-36m-x86_64-linux-gnu.so path/to/virtual/environment/libaruco.so.3.0. But it didn't work.

@mingliangfu
Copy link
Author

mingliangfu commented Jan 3, 2018

According to the tip in Test, I added the build library location LD_LIBRARY_PATH=/home/*/programs/python-aruco3/build/lib.linux-x86_64-3.6 to .bashrc. Unfortunately, it didn't work.

@fehlfarbe
Copy link
Owner

The generated wrapper library _aruco.cpython-36m-x86_64-linux-gnu.so depends on libaruco.so.3.0 which contains the ArUco stuff. libaruco.so.3.0 is created by compiling the ArUco lib (step 2: download, compile and install ArUco: http://www.uco.es/investiga/grupos/ava/node/26). So for your installation it should be in /home/*/programs/aruco304/install/lib or after make install in /usr/local/lib.

@mingliangfu
Copy link
Author

mingliangfu commented Jan 4, 2018

Hi @fehlfarbe , thanks for your attention and tips. I tried to add the ArUco lib location /home/*/programs/aruco304/install/lib to /.bashrc. Regrettably, the same issue still be around. I tried to make a link file by ln -s /home/*/programs/aruco304/install/lib/libaruco.so.3.0.4 /home/*/anaconda3/envs/py36/lib/python3.6/site-packages/libaruco.so.3.0. It failed for a second time. But what's baffling, the generated aruco lib files are indeed located in the path--/home/*/programs/aruco304/install/lib.

@fehlfarbe
Copy link
Owner

Mh that's really weird...what's the output of ldd _aruco.cpython-36m-x86_64-linux-gnu.so?
Is the path to aruco.so really in $LD_LIBRARY_PATH? Just check with echo $LD_LIBRARY_PATH.
Is the symlink valid? Check with ls -l /home/*/anaconda3/envs/py36/lib/python3.6/site-packages/libaruco.so.3.0.

Maybe just recompile the wrapper?! Does installation via pip (pip install aruco) work in your virtualenv?

@mingliangfu
Copy link
Author

mingliangfu commented Jan 5, 2018

THX for your continued support. Under the installation path--/home/*/programs/python-aruco3, the output of ldd are listed partly as follows:
...
libopencv_core.so.3.0 => /usr/local/lib/libopencv_core.so.3.0 (0x00007f66a21cc000)
libaruco.so.3.0 => /home/*/programs/aruco304/install/lib/libaruco.so.3.0 (0x00007f66a087c000)
...
libglib-2.0.so.0 => /home/*/anaconda3/envs/py36/lib/libglib-2.0.so.0 (0x00007f669d8be000)
libXdamage.so.1 => /usr/lib/x86_64-linux-gnu/libXdamage.so.1 (0x00007f669a8a4000)
...

Then, check the LD_LIBRARY_PATH:
/home/*/torch/install/lib:/home/*/freenect2/lib:/usr/local/lib:/usr/local/cuda/lib64:/home/*/programs/aruco304/install/lib:/home/*/anaconda3/envs/py36/lib/python3.6/site-packages:

Clearly, the aruco lib path has been included in LD_LIBRARY_PATH. Finally, the log output of the symlink is: 08:29 /home/*/anaconda3/envs/py36/lib/python3.6/site-packages/libaruco.so.3.0 -> /home/*/programs/aruco304/install/lib/libaruco.so.3.0.4. Thus, the link is still valid.

After the above checking, the issue is still around. During another attempt of reinstallation, output log of the terminal is : Requirement already satisfied: aruco in ./anaconda3/envs/py36/lib/python3.6/site-packages . However, the reinstallation didn't make a difference.

OK, I meant to leave it here for now. Thanks for your kind help again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants