【发布时间】:2021-11-22 10:45:39
【问题描述】:
我正在尝试使用pyautogui 在我的屏幕中查找图像,并设置了confidence 参数。
但它要求我安装 OpenCV,因为我已经安装了 opencv-python。
我的代码是这样的:
import pyautogui
location = pyautogui.locateOnScreen('123.png', confidence=1)
完整的错误信息:
raise NotImplementedError('The confidence keyword argument is only available if OpenCV is installed.')
NotImplementedError: The confidence keyword argument is only available if OpenCV is installed.
我的堆栈是:
- 虚拟环境
- Python 3
- Mac 操作系统
【问题讨论】: