将数码相机连接到 python 项目

connect digital camera to python project

是否可以使用 Python 语言读取任何摄像头(不是网络摄像头)? 根据我目前找到的答案,我尝试安装 gphoto 目录,但在安装时出现错误消息

<ERROR: command "pkg-config --modversion libgphoto2" failed Traceback (most recent call last): 
File "<string>", line 1, in <module> File "C:\Users\user\AppData\Local\Temp\pycharm-packaging\gphoto2\setup.py", 
line 38, in <module> cmd, stderr=FNULL, universal_newlines=True).split('.') File 
"C:\Users\user\AppData\Local\Programs\Python\Python37-32\lib\subprocess.py", line 395, in check_output **kwargs).stdout 
File "C:\Users\user\AppData\Local\Programs\Python\Python37-32\lib\subprocess.py", line 472, in run with Popen(*popenargs, **kwargs)
 as process: File "C:\Users\user\AppData\Local\Programs\Python\Python37-32\lib\subprocess.py", line 775, in __init__ restore_signals, start_new_session) File 
"C:\Users\user\AppData\Local\Programs\Python\Python37-32\lib\subprocess.py", line 1178, in _execute_child startupinfo) 
FileNotFoundError: [WinError 2] The system cannot find the file specifiedd the error message>.

我试过直接从Gitab下载库,通过电脑添加,也是在Python安装失败。 我使用 Windows 操作系统,PyCharm 工作区,Python 3.6。 谢谢!

该错误消息的重要部分是 command "pkg-config --modversion libgphoto2" failedpkg-config 命令在 Linux 上是标准命令,但您使用的是 Windows。

根据 GPhoto 常见问题解答 (http://www.gphoto.org/doc/manual/FAQ.html#FAQ-Windows) Windows support is unlikely to happen. However you can install it with MSYS2 (http://www.msys2.org/),其中还有 Python 等。您可能需要卸载相机的 Windows 驱动程序。我不确定您还需要做什么才能让 libgphoto2 与您的相机对话。

[编辑以删除无用的建议并添加更多背景。]