简体   繁体   English

将数码相机连接到 python 项目

[英]connect digital camera to python project

Is it possible to read any camera (not a webcam) using Python language?是否可以使用 Python 语言读取任何相机(不是网络摄像头)? According to the answers I have found so far, I have tried to install the gphoto directory but I get an error message in the installation根据我到目前为止找到的答案,我尝试安装 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>.

I tried to download the library directly from Gitab and add it through the computer but also failed to install it in Python.我尝试直接从Gitab下载库并通过电脑添加,但在Python中安装也失败。 I work with the Windows operating system, PyCharm workspace, Python 3.6.我使用 Windows 操作系统、PyCharm 工作区、Python 3.6。 Thank you!谢谢!

The important bit of that error message is command "pkg-config --modversion libgphoto2" failed .该错误消息的重要部分是command "pkg-config --modversion libgphoto2" failed The pkg-config command is standard on Linux, but you're using Windows. pkg-config命令是 Linux 上的标准命令,但您使用的是 Windows。

According to the GPhoto FAQ ( http://www.gphoto.org/doc/manual/FAQ.html#FAQ-Windows ) Windows support is unlikely to happen.根据 GPhoto 常见问题解答 ( http://www.gphoto.org/doc/manual/FAQ.html#FAQ-Windows ) Windows 支持不太可能发生。 However you can install it with MSYS2 ( http://www.msys2.org/ ) which also has Python etc. You will probably need to uninstall your camera's Windows driver.但是,您可以使用 MSYS2 ( http://www.msys2.org/ ) 安装它,它也有 Python 等。您可能需要卸载相机的 ZAEA23489CE3AA9B6406EBB28E0CDA43 驱动程序。 I'm not sure what else you'll need to do to get libgphoto2 talking to your camera.我不确定您还需要做什么才能让 libgphoto2 与您的相机对话。

[Edited to remove unhelpful suggestion and to add more background.] [编辑删除无用的建议并添加更多背景。]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM