Closed dmitryelj closed 6 years ago
You shouldn't need LD_LIBRARY_PATH
at all if you use your system's package manager to install libgphoto2 (plus development headers) before installing python-gphoto2. If you're using /usr/local/lib
that suggests you've compiled your own libgphoto2. You may need to run ldconfig
after installing your locally compiled version. Make sure you have no remnants of the package manager's libgphoto2 that might be used instead. You can use ldd
to see what libraries the python-gphoto2 compiled files (e.g. _camera.so or similar name) are using.
Yes, I compiled the latest version.
"sudo ldconfig" did not help. Its not critical issue for sure, I just want to understand why it does not work.
It doesn't work because python-gphoto2 is linked to the wrong version of one of the gphoto2 libraries. Use ldd
to check this and then remove any old versions. Then reinstall python-gphoto2 so it links with the new version.
https://github.com/jim-easterbrook/python-gphoto2#reinstalling
Thanks man, it works.
It looks, Python is loading the libraries before running the script, thats why the command in the script was not working.
Hi Jim,
Thanks again for the cool product. A small question, in it I stuck with:
I have a script "cam.py" that connects with my camera. I need to set LD_LIBRARY_PATH="/usr/local/lib" to use the library.
This works ok: "sudo LD_LIBRARY_PATH=/usr/local/lib python cam.py". But I'm too lazy to type it every time again and again :)
I tried to put variable at the beginning of the script, but it does not work. try-1: os.system('export LD_LIBRARY_PATH="/usr/local/lib"; echo $LD_LIBRARY_PATH') try-2: os.putenv('LD_LIBRARY_PATH', '/usr/local/lib') try-3: os.environ['LD_LIBRARY_PATH'] = "/usr/local/lib" try-4: added "LD_LIBRARY_PATH=/usr/local/lib" to /etc/profile.
No success - I didn't get any error, but cannot connect the camera: in string "camera.init(context)" I getting the exception: gphoto2.GPhoto2Error: [-105] Unknown model
Why? 'echo $LD_LIBRARY_PATH' in bash shows me correct "/usr/local/lib".
Thanks.