Index: piggyphoto-0.1dev/piggyphoto/__init__.py
===================================================================
--- piggyphoto-0.1dev.orig/piggyphoto/__init__.py
+++ piggyphoto-0.1dev/piggyphoto/__init__.py
@@ -5,6 +5,7 @@
 # - libgphoto2 Python bindings by David PHAM-VAN <david@ab2r.com>
 # - ctypes_gphoto2.py by Hans Ulrich Niedermann <gp@n-dimensional.de>
 
+import ctypes
 import platform
 
 # Some functions return errors which can be fixed by retrying.
@@ -15,17 +16,21 @@ retries = 1
 # This is run if gp_camera_init returns -60 (Could not lock the device) and retries >= 1.
 if platform.system() == 'Darwin':
     unmount_cmd = 'killall PTPCamera'
-    libgphoto2dll = 'libgphoto2.dylib'
+    gp = ctypes.CDLL('libgphoto2.dylib')
 elif platform.system() == 'Windows':
-    libgphoto2dll = 'libgphoto2.dll'
     unmount_cmd = None
+    gp = ctypes.CDLL('libgphoto2.dll')
 else:
     libgphoto2dll = 'libgphoto2.so'
     unmount_cmd = 'gvfs-mount -s gphoto2'
+    for name in 'libgphoto2.so', 'libgphoto2.so.2', 'libgphoto2.so.6':
+        try:
+            gp = ctypes.CDLL(name)
+            break
+        except OSError:
+            continue
 
 import re
-import ctypes
-gp = ctypes.CDLL(libgphoto2dll)
 gp.gp_context_new.restype = ctypes.c_void_p
 context = gp.gp_context_new()
 
