Using USB API (MTP) with libghoto2 and Python bindings on MacOS, Raspberry Pi, Linux, ROS

@mhenrie 's program on Ras-pi

What ?! Of course I installed libgphoto2 and PygPhoto2.

Traceback (most recent call last):
File “huga.py”, line 13, in
import gphoto2 as gp
ImportError: No module named gphoto2

Probably because of the lack of a path. I’m too sleepy to come up with a solution.

20/09/27 Added because the problem has been solved.

I installed gPhoto2 in pip, which is pip3 and works fine in Python3.
However, I didn’t install it in pip2, so it didn’t work in Python2.
The un-numbered Python in raspberry pi refers to 2, so that’s why it didn’t work.

What a rudimentary error.

Also, after resolving this, I had the usual mount-related errors, and since this is a CUI environment and I couldn’t use the sequential unmounting method by gvfs-mount, which I often use in my environment, I solved it by removing gvfs-backends and got it running.

The conclusion is that the first experiment failed as expected.

According to this article, the reason why gvfs-mount is not available can be solved by apt install gvfs-dbg.

However, when I looked closely, I saw an error in a different area. The error occurred one step or line later than last time.

Traceback (most recent call last):
File “huga.py”, line 234, in
_unittest()
File “huga.py”, line 210, in _unittest
camera.init()
File “huga.py”, line 118, in init
fstop = self.other_config.get_child_by_name(F_NUMBER)
gphoto2.GPhoto2Error: [-2] Bad parameters