Before install python-gphoto2, we have to install libgphoto2, I run the gphoto2-updater script to install gphoto2 and libgphoto2 on Raspberry Pi 2/Raspbian Jessie. After finished, gphoto2 2.5.8 and libgphoto2 2.5.4 will be installed.
- Install python-dev
$ sudo apt-get install python-dev
- install python-gphoto2 with pip
$ sudo pip install gphoto2
If you installed with pip the example files should be in /usr/share/python-gphoto2/examples or /usr/local/share/python-gphoto2/examples or somewhere similar. Otherwise they are in the examples sub-directory of your working directory. In Raspbian Jessie, it should be in /usr/local/share/python-gphoto2/examples.
Connect a digital camera to your Raspberry Pi, switch it on, and unmount it before access with Python, and try one of the example programs:
$ python camera-summary.py
In my first test, I can run example of camera-summary.py to list details of the connected camera, but fail to capture image, with Segmentation fault!
In order to verify the steps, I redo it on Raspberry Pi (1st generation, NOT 2)/Raspbian Wheezy. Read "Install python-gphoto2 on Raspberry Pi/Raspbian Wheezy - success".
After install both gphoto and libgphoto2 of the same version 2.5.9, we can install python-gphoto2 and capture image successful.