Jython 打开默认系统网络摄像头
我想制作一个工具来打开系统默认网络摄像头并返回拍摄/所选图像的路径。
我尝试使用 cv2 python 库,但无法安装它,在控制台中报告了以下错误:
jython -m pip install cv2
弃用:未来 pip 版本将放弃对 Python 2.7 的支持。收藏 opencv-python 错误:证书与预期主机名不匹配: pypi.org。证书: {'notAfter': '2022 年 11 月 23 日 18:41:10 GMT', '主题': ((('commonName', 'www.python.org'),),), 'subjectAltName': (('DNS', 'www.python.org'), ('DNS', '.python.org'), ('DNS', 'docs.python.org'), ('DNS', 'downloads.python.org'), ('DNS', 'pypi.python.org'))} 警告:重试(重试(总计=4,连接=无, 连接中断后,读取=无、重定向=无、状态=无)) 'SSLError(CertificateError("主机名 'pypi.org' 也不匹配) 'www.python.org'、'.python.org'、'docs.python.org'、 'downloads.python.org'、'pypi.python.org'",),)': /simple/opencv-python/ 错误:证书与预期不匹配 主机名:pypi.org。证书:{'notAfter':'2022 年 11 月 23 日 18:41:10 GMT', '主题': ((('commonName', 'www.python.org'),),), 'subjectAltName': (('DNS', 'www.python.org'), ('DNS', '.python.org'), ('DNS', 'docs.python.org'), ('DNS', 'downloads.python.org'), ('DNS', 'pypi.python.org'))} 警告:重试(重试(总计 = 3,连接 = 无, 连接中断后,读取=无、重定向=无、状态=无)) 'SSLError(CertificateError("主机名 'pypi.org' 也不匹配) 'www.python.org'、'.python.org'、'docs.python.org'、 'downloads.python.org'、'pypi.python.org'",),)': /simple/opencv-python/ 错误:证书与预期不匹配 主机名:pypi.org。证书:{'notAfter':'2022 年 11 月 23 日 18:41:10 GMT', '主题': ((('commonName', 'www.python.org'),),), 'subjectAltName': (('DNS', 'www.python.org'), ('DNS', '.python.org'), ('DNS', 'docs.python.org'), ('DNS', 'downloads.python.org'), ('DNS', 'pypi.python.org'))} 警告:重试(重试(总计=2,连接=无, 连接中断后,读取=无、重定向=无、状态=无)) 'SSLError(CertificateError("主机名 'pypi.org' 也不匹配) 'www.python.org'、'.python.org'、'docs.python.org'、 'downloads.python.org'、'pypi.python.org'",),)': /simple/opencv-python/ 错误:证书与预期不匹配 主机名:pypi.org。证书:{'notAfter':'2022 年 11 月 23 日 18:41:10 GMT', '主题': ((('commonName', 'www.python.org'),),), 'subjectAltName': (('DNS', 'www.python.org'), ('DNS', '.python.org'), ('DNS', 'docs.python.org'), ('DNS', 'downloads.python.org'), ('DNS', 'pypi.python.org'))} 警告:重试(重试(总计=1,连接=无, 连接中断后,读取=无、重定向=无、状态=无)) 'SSLError(CertificateError("主机名 'pypi.org' 也不匹配) 'www.python.org'、'.python.org'、'docs.python.org'、 'downloads.python.org'、'pypi.python.org'",),)': /simple/opencv-python/ 错误:证书与预期不匹配 主机名:pypi.org。证书:{'notAfter':'2022 年 11 月 23 日 18:41:10 GMT', '主题': ((('commonName', 'www.python.org'),),), 'subjectAltName': (('DNS', 'www.python.org'), ('DNS', '.python.org'), ('DNS', 'docs.python.org'), ('DNS', 'downloads.python.org'), ('DNS', 'pypi.python.org'))} 警告:重试(重试(总计=0,连接=无, 连接中断后,读取=无、重定向=无、状态=无)) 'SSLError(CertificateError("主机名 'pypi.org' 也不匹配) 'www.python.org'、'.python.org'、'docs.python.org'、 'downloads.python.org'、'pypi.python.org'",),)': /simple/opencv-python/ 错误:证书与预期不匹配 主机名:pypi.org。证书:{'notAfter':'2022 年 11 月 23 日 18:41:10 GMT', '主题': ((('commonName', 'www.python.org'),),), 'subjectAltName': (('DNS', 'www.python.org'), ('DNS', '.python.org'), ('DNS', 'docs.python.org'), ('DNS', 'downloads.python.org'), ('DNS', 'pypi.python.org'))} 无法获取 URL https://pypi.org/simple/opencv-python/:出现问题确认 ssl 证书:HTTPSConnectionPool(host='pypi.org', port=443): url 超出最大重试次数:/simple/opencv-python/(由以下原因引起) SSLError(CertificateError(“主机名 'pypi.org' 与以下任一者都不匹配) 'www.python.org', '.python.org', 'docs.python.org', 'downloads.python.org'、'pypi.python.org'",),)) - 跳过错误: 找不到满足opencv-python要求的版本 (来自版本:无)错误:找不到匹配的发行版 opencv-python 错误:证书与预期主机名不匹配: pypi.org。证书: {'notAfter': '2022 年 11 月 23 日 18:41:10 GMT', '主题': ((('commonName', 'www.python.org'),),), 'subjectAltName': (('DNS', 'www.python.org'), ('DNS', '.python.org'), ('DNS', 'docs.python.org'), ('DNS', 'downloads.python.org'), ('DNS', 'pypi.python.org'))} 无法获取 URL https://pypi.org/simple/pip /: 确认 ssl 证书时出现问题: HTTPSConnectionPool(主机='pypi.org',端口=443):超出最大重试次数 url: /simple/pip/ (由 SSLError(CertificateError("hostname 'pypi.org' 与 'www.python.org'、'.python.org' 都不匹配, 'docs.python.org'、'downloads.python.org'、'pypi.python.org'",),)) - 跳过
我想知道这个库对于 python 版本 2.7 来说是否不太先进,并且我想知道使用 python 而不是 java 来完成此任务是否是最佳选择。
提前致谢。
I would like to make a tool that opens the system default web cam and returns the paths of the taken/selected images.
I tried to use the cv2 python library, but I couldn't install it, having reported the following error in console:
jython -m pip install cv2
DEPRECATION: A future
version of pip will drop support for Python 2.7. Collecting
opencv-python ERROR: Certificate did not match expected hostname:
pypi.org. Certificate: {'notAfter': 'Nov 23 18:41:10 2022 GMT',
'subject': ((('commonName', 'www.python.org'),),), 'subjectAltName':
(('DNS', 'www.python.org'), ('DNS', '.python.org'), ('DNS',
'docs.python.org'), ('DNS', 'downloads.python.org'), ('DNS',
'pypi.python.org'))} WARNING: Retrying (Retry(total=4, connect=None,
read=None, redirect=None, status=None)) after connection broken by
'SSLError(CertificateError("hostname 'pypi.org' doesn't match either
of 'www.python.org', '.python.org', 'docs.python.org',
'downloads.python.org', 'pypi.python.org'",),)':
/simple/opencv-python/ ERROR: Certificate did not match expected
hostname: pypi.org. Certificate: {'notAfter': 'Nov 23 18:41:10 2022
GMT', 'subject': ((('commonName', 'www.python.org'),),),
'subjectAltName': (('DNS', 'www.python.org'), ('DNS', '.python.org'),
('DNS', 'docs.python.org'), ('DNS', 'downloads.python.org'), ('DNS',
'pypi.python.org'))} WARNING: Retrying (Retry(total=3, connect=None,
read=None, redirect=None, status=None)) after connection broken by
'SSLError(CertificateError("hostname 'pypi.org' doesn't match either
of 'www.python.org', '.python.org', 'docs.python.org',
'downloads.python.org', 'pypi.python.org'",),)':
/simple/opencv-python/ ERROR: Certificate did not match expected
hostname: pypi.org. Certificate: {'notAfter': 'Nov 23 18:41:10 2022
GMT', 'subject': ((('commonName', 'www.python.org'),),),
'subjectAltName': (('DNS', 'www.python.org'), ('DNS', '.python.org'),
('DNS', 'docs.python.org'), ('DNS', 'downloads.python.org'), ('DNS',
'pypi.python.org'))} WARNING: Retrying (Retry(total=2, connect=None,
read=None, redirect=None, status=None)) after connection broken by
'SSLError(CertificateError("hostname 'pypi.org' doesn't match either
of 'www.python.org', '.python.org', 'docs.python.org',
'downloads.python.org', 'pypi.python.org'",),)':
/simple/opencv-python/ ERROR: Certificate did not match expected
hostname: pypi.org. Certificate: {'notAfter': 'Nov 23 18:41:10 2022
GMT', 'subject': ((('commonName', 'www.python.org'),),),
'subjectAltName': (('DNS', 'www.python.org'), ('DNS', '.python.org'),
('DNS', 'docs.python.org'), ('DNS', 'downloads.python.org'), ('DNS',
'pypi.python.org'))} WARNING: Retrying (Retry(total=1, connect=None,
read=None, redirect=None, status=None)) after connection broken by
'SSLError(CertificateError("hostname 'pypi.org' doesn't match either
of 'www.python.org', '.python.org', 'docs.python.org',
'downloads.python.org', 'pypi.python.org'",),)':
/simple/opencv-python/ ERROR: Certificate did not match expected
hostname: pypi.org. Certificate: {'notAfter': 'Nov 23 18:41:10 2022
GMT', 'subject': ((('commonName', 'www.python.org'),),),
'subjectAltName': (('DNS', 'www.python.org'), ('DNS', '.python.org'),
('DNS', 'docs.python.org'), ('DNS', 'downloads.python.org'), ('DNS',
'pypi.python.org'))} WARNING: Retrying (Retry(total=0, connect=None,
read=None, redirect=None, status=None)) after connection broken by
'SSLError(CertificateError("hostname 'pypi.org' doesn't match either
of 'www.python.org', '.python.org', 'docs.python.org',
'downloads.python.org', 'pypi.python.org'",),)':
/simple/opencv-python/ ERROR: Certificate did not match expected
hostname: pypi.org. Certificate: {'notAfter': 'Nov 23 18:41:10 2022
GMT', 'subject': ((('commonName', 'www.python.org'),),),
'subjectAltName': (('DNS', 'www.python.org'), ('DNS', '.python.org'),
('DNS', 'docs.python.org'), ('DNS', 'downloads.python.org'), ('DNS',
'pypi.python.org'))} Could not fetch URL
https://pypi.org/simple/opencv-python/: There was a problem confirming
the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443):
Max retries exceeded with url: /simple/opencv-python/ (Caused by
SSLError(CertificateError("hostname 'pypi.org' doesn't match either of
'www.python.org', '.python.org', 'docs.python.org',
'downloads.python.org', 'pypi.python.org'",),)) - skipping ERROR:
Could not find a version that satisfies the requirement opencv-python
(from versions: none) ERROR: No matching distribution found for
opencv-python ERROR: Certificate did not match expected hostname:
pypi.org. Certificate: {'notAfter': 'Nov 23 18:41:10 2022 GMT',
'subject': ((('commonName', 'www.python.org'),),), 'subjectAltName':
(('DNS', 'www.python.org'), ('DNS', '.python.org'), ('DNS',
'docs.python.org'), ('DNS', 'downloads.python.org'), ('DNS',
'pypi.python.org'))} Could not fetch URL https://pypi.org/simple/pip/:
There was a problem confirming the ssl certificate:
HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded
with url: /simple/pip/ (Caused by SSLError(CertificateError("hostname
'pypi.org' doesn't match either of 'www.python.org', '.python.org',
'docs.python.org', 'downloads.python.org', 'pypi.python.org'",),)) -
skipping
I was wondering if the library wasn't too advanced for python version 2.7, and I was wondering if using python instead of java for this task was the best choice.
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论