gphoto を正しくインストールして、カメラのすべての機能を使用できますが、何らかの理由で
gphoto = ctypes.CDLL('libgphoto2.dylib')
エラーをスローします。
$ python
Python 2.7.5 (default, Aug 25 2013, 00:04:04)
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import ctypes
>>> gphoto = ctypes.CDLL('libgphoto2.dylib')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py", line 365, in __init__
self._handle = _dlopen(self._name, mode)
OSError: dlopen(libgphoto2.dylib, 6): image not found
>>>
macports を使用して libgphoto2 をインストールしましたが、前述のように gphoto は正常に動作します。
$ gphoto2 --capture-image-and-download
New file is in location /capt0000.nef on the camera
Saving file as capt0000.nef
Deleting file /capt0000.nef on the camera
Deleting 'capt0000.nef' from folder '/'...
したがって、gphoto2 では libgphoto2 を使用できるのに ctypes では使用できない理由がわかりません。助言がありますか?私はこれに非常に慣れていないので、おそらく本当に基本的で愚かな間違いです。