We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
locateAllOnScreen
pyscreeze.ImageNotFoundException
>>> list(pyautogui.locateAllOnScreen("test.png")) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Users\eight04\dev\valkyrie-connect-auto\.venv\Lib\site-packages\pyscreeze\__init__.py", line 257, in _locateAll_opencv raise ImageNotFoundException('Could not locate the image (highest confidence = %.3f)' % result.max()) pyscreeze.ImageNotFoundException: Could not locate the image (highest confidence = 0.178)
While locateOnScreen raises pyautogui.ImageNotFoundException correctly:
locateOnScreen
pyautogui.ImageNotFoundException
>>> pyautogui.locateOnScreen("test.png") Traceback (most recent call last): File "C:\Users\eight04\dev\valkyrie-connect-auto\.venv\Lib\site-packages\pyautogui\__init__.py", line 172, in wrapper return wrappedFunction(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\eight04\dev\valkyrie-connect-auto\.venv\Lib\site-packages\pyautogui\__init__.py", line 210, in locateOnScreen return pyscreeze.locateOnScreen(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\eight04\dev\valkyrie-connect-auto\.venv\Lib\site-packages\pyscreeze\__init__.py", line 405, in locateOnScreen retVal = locate(image, screenshotIm, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\eight04\dev\valkyrie-connect-auto\.venv\Lib\site-packages\pyscreeze\__init__.py", line 383, in locate points = tuple(locateAll(needleImage, haystackImage, **kwargs)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\eight04\dev\valkyrie-connect-auto\.venv\Lib\site-packages\pyscreeze\__init__.py", line 257, in _locateAll_opencv raise ImageNotFoundException('Could not locate the image (highest confidence = %.3f)' % result.max()) pyscreeze.ImageNotFoundException: Could not locate the image (highest confidence = 0.167) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Users\eight04\dev\valkyrie-connect-auto\.venv\Lib\site-packages\pyautogui\__init__.py", line 174, in wrapper raise ImageNotFoundException # Raise PyAutoGUI's ImageNotFoundException. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pyautogui.ImageNotFoundException
I guess the problem is that locateAll returns a generator, hence you have to wrap its __next__ method to catch the error, or use yield from.
locateAll
__next__
yield from
The text was updated successfully, but these errors were encountered:
It looks like this is an issue related to pyscreeze - please try to install pyscreeze at the version 0.1.29 as described in this issue
pyscreeze
Sorry, something went wrong.
No branches or pull requests
While
locateOnScreen
raisespyautogui.ImageNotFoundException
correctly:I guess the problem is that
locateAll
returns a generator, hence you have to wrap its__next__
method to catch the error, or useyield from
.The text was updated successfully, but these errors were encountered: