Closed Tornbloj closed 5 years ago
I suspect this is a similar problem to issue #48. How have you installed libgphoto2?
Yes it is installed. Maybe i've missed something?
I followed the steps described in issue #48
What i can see is that libgphoto2_port.so.10 is missing. Might this be the problem? How do fix this?
gphoto2 pi@raspberrypi:/usr/bin $ ldd gphoto2 /usr/lib/arm-linux-gnueabihf/libarmmem.so (0xb6ebb000) libgphoto2.so.6 => /usr/lib/arm-linux-gnueabihf/libgphoto2.so.6 (0xb6e14000) libgphoto2_port.so.12 => /usr/lib/arm-linux-gnueabihf/libgphoto2_port.so.12 (0xb6dfa000) libcdk.so.5 => /usr/lib/arm-linux-gnueabihf/libcdk.so.5 (0xb6db8000) libncurses.so.5 => /lib/arm-linux-gnueabihf/libncurses.so.5 (0xb6d8c000) libaa.so.1 => /usr/lib/arm-linux-gnueabihf/libaa.so.1 (0xb6d62000) libjpeg.so.62 => /usr/lib/arm-linux-gnueabihf/libjpeg.so.62 (0xb6d1c000) libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0xb6cf3000) libexif.so.12 => /usr/lib/arm-linux-gnueabihf/libexif.so.12 (0xb6cb0000) libreadline.so.7 => /lib/arm-linux-gnueabihf/libreadline.so.7 (0xb6c64000) libpopt.so.0 => /lib/arm-linux-gnueabihf/libpopt.so.0 (0xb6c49000) libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0xb6bca000) libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0xb6a8b000) /lib/ld-linux-armhf.so.3 (0xb6f02000) libltdl.so.7 => /usr/lib/arm-linux-gnueabihf/libltdl.so.7 (0xb6a73000) libtinfo.so.5 => /lib/arm-linux-gnueabihf/libtinfo.so.5 (0xb6a44000) libdl.so.2 => /lib/arm-linux-gnueabihf/libdl.so.2 (0xb6a31000) libslang.so.2 => /lib/arm-linux-gnueabihf/libslang.so.2 (0xb682e000) libX11.so.6 => /usr/lib/arm-linux-gnueabihf/libX11.so.6 (0xb670b000) libgpm.so.2 => /usr/lib/arm-linux-gnueabihf/libgpm.so.2 (0xb66f6000) libxcb.so.1 => /usr/lib/arm-linux-gnueabihf/libxcb.so.1 (0xb66c7000) libXau.so.6 => /usr/lib/arm-linux-gnueabihf/libXau.so.6 (0xb66bc000) libXdmcp.so.6 => /usr/lib/arm-linux-gnueabihf/libXdmcp.so.6 (0xb66a7000) libbsd.so.0 => /lib/arm-linux-gnueabihf/libbsd.so.0 (0xb667e000)
_camera.so pi@raspberrypi:/usr/local/lib/python3.5/dist-packages/gphoto2 $ ldd _camera.cpython-35m-arm-linux-gnueabihf.so /usr/lib/arm-linux-gnueabihf/libarmmem.so (0xb6f48000) libgphoto2.so.6 => /usr/lib/arm-linux-gnueabihf/libgphoto2.so.6 (0xb6ea1000) libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0xb6e22000) libgphoto2_port.so.10 => not found libexif.so.12 => /usr/lib/arm-linux-gnueabihf/libexif.so.12 (0xb6ddf000) libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0xb6db6000) libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0xb6c77000) /lib/ld-linux-armhf.so.3 (0xb6f90000) libgphoto2_port.so.12 => /usr/lib/arm-linux-gnueabihf/libgphoto2_port.so.12 (0xb6c5d000) libltdl.so.7 => /usr/lib/arm-linux-gnueabihf/libltdl.so.7 (0xb6c45000) libdl.so.2 => /lib/arm-linux-gnueabihf/libdl.so.2 (0xb6c32000)
Update: Ran: sudo ldconfig and it seems to work. Next problem occurs when i am trying to run the test file:
pi@raspberrypi:/usr/local/share/python-gphoto2/examples $ sudo python3 camera-summary.py Summary
Traceback (most recent call last): File "camera-summary.py", line 59, in
sys.exit(main()) File "camera-summary.py", line 36, in main print(text.text) UnicodeEncodeError: 'utf-8' codec can't encode character '\udcf6' in position 77: surrogates not allowed
The ldd
output shows that gphoto2
was compiled with libgphoto2_port.so.12
but python-gphoto2
was compiled (i.e. installed) with libgphoto2_port.so.10
. The usual cure for this is to reinstall, as described in the README.
https://github.com/jim-easterbrook/python-gphoto2#reinstalling
The camera-summary error suggests your camera is not using utf-8 encoding for non-ASCII characters. You could try changing line 36 to
print(text.text.decode('utf8','replace'))
I've found out a bit more about this "surrogate" thing. You should be able to retrieve the original bytes by using text.text.encode('utf-8', errors='surrogateescape')
. See http://www.swig.org/Doc3.0/Python.html#Python_nn77 for more info.
Installed using pip3.
When running:
I get the following error:
Have any idea of the reason?