Traceback (most recent call last): File "F:\studyspace\waterRPA\waterRPA.py", line 159, in <module> mainWork(flow_sheet) File "F:\studyspace\waterRPA\waterRPA.py", line 114, in mainWork mouseClick(2, "left", img, reTry) File "F:\studyspace\waterRPA\waterRPA.py", line 14, in mouseClick location = pyautogui.locateCenterOnScreen(img, confidence=0.9) File "D:\installation\miniconda\lib\site-packages\pyautogui\__init__.py", line 172, in wrapper return wrappedFunction(*args, **kwargs) File "D:\installation\miniconda\lib\site-packages\pyautogui\__init__.py", line 204, in locateCenterOnScreen return pyscreeze.locateCenterOnScreen(*args, **kwargs) File "D:\installation\miniconda\lib\site-packages\pyscreeze\__init__.py", line 420, in locateCenterOnScreen coords = locateOnScreen(image, **kwargs) File "D:\installation\miniconda\lib\site-packages\pyscreeze\__init__.py", line 378, in locateOnScreen retVal = locate(image, screenshotIm, **kwargs) File "D:\installation\miniconda\lib\site-packages\pyscreeze\__init__.py", line 356, in locate points = tuple(locateAll(needleImage, haystackImage, **kwargs)) File "D:\installation\miniconda\lib\site-packages\pyscreeze\__init__.py", line 247, in _locateAll_pillow 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.
时间: 2023-06-30 20:21:58 浏览: 197
Mac下anaconda中Spyder打开报错Traceback(most recent call last)…问题
5星 · 资源好评率100%
这个错误提示是因为你的代码中使用了 PyAutoGUI 库中的 locateCenterOnScreen 函数,并且在其中使用了 confidence 参数,但是你的环境中没有安装 OpenCV 库。要解决这个问题,你需要安装 OpenCV 库。你可以在命令行中使用以下命令安装 OpenCV:
```
pip install opencv-python
```
安装完成后,你的代码应该就可以正常运行了。
阅读全文