DIYBookScanner / spreads

Modular workflow assistant for book digitization
GNU Affero General Public License v3.0
127 stars 53 forks source link

spread configure gphoto2camera AttributeError: 'module' object has no attribute 'list_cameras' #221

Closed jayvdb closed 8 years ago

jayvdb commented 8 years ago
$ spread configure
Please select a device driver from the following list:
  [0]: Keep current (gphoto2camera)
  [1]: gphoto2camera
  [2]: chdkcamera
  [3]: dummy
  [4]: None
Select a driver: 
Please select your desired plugins from the following list:
    1: autorotate
    2: djvubind
    3: gui
    4: hidtrigger
    5: intervaltrigger
    6: pdfbeads
    7: scantailor
    8: tesseract
    9: web
Select a plugin (or hit enter to finish): 
Do you want to configure the target_page of your devices?
(Required for shooting with two devices) [y/N]: y
Setting target page on cameras
Please connect and turn on the device labeled 'odd'
Press any key when ready.
spreads encountered an error:
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/spreads-0.5git20160405.a94b-py2.7.egg/spreads/main.py", line 321, in main
    run()
  File "/usr/lib/python2.7/site-packages/spreads-0.5git20160405.a94b-py2.7.egg/spreads/main.py", line 308, in run
    args.subcommand(config)
  File "/usr/lib/python2.7/site-packages/spreads-0.5git20160405.a94b-py2.7.egg/spreads/cli.py", line 232, in configure
    _set_device_target_page(config, target_page)
  File "/usr/lib/python2.7/site-packages/spreads-0.5git20160405.a94b-py2.7.egg/spreads/cli.py", line 177, in _set_device_target_page
    devs = plugin.get_devices(config, force_reload=True)
  File "/usr/lib/python2.7/site-packages/spreads-0.5git20160405.a94b-py2.7.egg/spreads/plugin.py", line 480, in get_devices
    devices = list(driver.yield_devices(config['device']))
  File "/usr/lib/python2.7/site-packages/spreads-0.5git20160405.a94b-py2.7.egg/spreadsplug/dev/gphoto2camera.py", line 47, in yield_devices
    for cam in gphoto2.list_cameras():
AttributeError: 'module' object has no attribute 'list_cameras'
jbaiter commented 8 years ago

Can you tell me what running pip freeze |grep gphoto returns for you?

I changed the module name from gphoto2 to gphoto2cffi in the latest gphoto2-cffi alpha release. However, this is not yet published on PyPi, so as long as you didn't install gphoto2-cffi from a source checkout you shouldn't run into this problem....

jayvdb commented 8 years ago

I did install gphoto2-cffi from source.

jbaiter commented 8 years ago

There you go, please stick to the version on PyPi (i.e. pip install gphoto2-cffi) for now. There are no significant changes from 0.2 to 0.3 that affect the driver behavior, so it's not really worth the upgrade.