I've worked with gphoto2 (2.5.20, on a RPi) before, and have been able to do the basics from the command line:
/usr/bin/gphoto2 --capture-image-and-download --filename=zzz.jpg --force-overwrite
/usr/bin/gphoto2 --capture-preview --filename=zzz.jpg --force-overwrite
The latter captures the preview image, which is a great deal smaller, and for some applications, is great; you can essentially make a webcam out of a DSLR.
However, after installing the gphoto2 library for python, this (which should be the equivalent) fails:
import gphoto2 as gp
camera = gp.Camera()
camera.init()
file_path = camera.capture(gp.GP_OPERATION_CAPTURE_PREVIEW)
with the message "gphoto2.GPhoto2Error: [-6] Unsupported operation"
If you choose
file_path = camera.capture(gp.GP_CAPTURE_IMAGE)
however, this works. Any reasons why we might get a working preview from the command line, and not in the Python version?
gp.__version__
returns 2.2.2 , and matches the latest release at https://github.com/jim-easterbrook/python-gphoto2