将libgphoto2.dylib加载到python时出现问题

2024-06-26 03:27:26 发布

您现在位置:Python中文网/ 问答频道 /正文

我有gphoto安装正确,我可以使用我的相机的所有功能,但出于某些原因

gphoto = ctypes.CDLL('libgphoto2.dylib')

抛出一个错误。在

^{pr2}$

我用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不能。有什么建议吗?我对这个很陌生,所以这可能是一个非常基本、愚蠢的错误。在


Tags: the功能on错误原因ctypeslibgphoto2file