Open Maxim-Ryzhenkov opened 1 year ago
Could you provide the code you were using that resulted in this issue? I was able to replicate that error but it was fixed by installing python-opencv.
Could you provide the code you were using that resulted in this issue? I was able to replicate that error but it was fixed by installing python-opencv.
- @jtranquilli
That can not be true because there is no "python-opencv" package. You likely meant "opencv-python". Your comment was absolutely no help and not regarding the topic.
I'm having the same issue.
python code:
py import pyautogui ImageBox = pyautogui.locateOnScreen(image, grayscale=grayscale, confidence=confidence)
pip-freeze & py -v:
opencv-python==4.10.0.84 PyAutoGUI==0.9.54
Python 3.11.9
@ conda 24.7.1 @ Win11
Error:
File "%User%\anaconda3\Lib\site-packages\pyscreeze\__init__.py", line 273, 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.
@Maxim-Ryzhenkov what opencv - version did you roll back to? 4.5.X?
I have a working version opencv-python 4.6.0.66 installed
The 'confidence' parameter in the 'locate_on_screen' method doesn't work with opencv-python v 4.7.0.72 The stacktrace output looks like the library is not installed, but it is not. The error appeared when upgrading from version 4.5.4.60. Rolling back opencv to an older version solved the problem.