Skip to content
New issue

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

Cant use one second monitor #13

Open
Drag0nK opened this issue Jan 24, 2024 · 1 comment
Open

Cant use one second monitor #13

Drag0nK opened this issue Jan 24, 2024 · 1 comment

Comments

@Drag0nK
Copy link

Drag0nK commented Jan 24, 2024

im trying to use the image recognition thing and
i think it cant find the image even tho its the same name with the file type
this is what i get
`Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.

========================= RESTART: D:\Bot\Fishing.py =========================
Traceback (most recent call last):
File "C:\Users\user\AppData\Local\Programs\Python\Python37\lib\site-packages\pyautogui_init_.py", line 172, in wrapper
return wrappedFunction(*args, **kwargs)
File "C:\Users\user\AppData\Local\Programs\Python\Python37\lib\site-packages\pyautogui_init_.py", line 210, in locateOnScreen
return pyscreeze.locateOnScreen(*args, **kwargs)
File "C:\Users\user\AppData\Local\Programs\Python\Python37\lib\site-packages\pyscreeze_init_.py", line 405, in locateOnScreen
retVal = locate(image, screenshotIm, **kwargs)
File "C:\Users\user\AppData\Local\Programs\Python\Python37\lib\site-packages\pyscreeze_init_.py", line 383, in locate
points = tuple(locateAll(needleImage, haystackImage, **kwargs))
File "C:\Users\user\AppData\Local\Programs\Python\Python37\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.125)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "D:\Bot\Fishing.py", line 9, in
if pyautogui.locateOnScreen('stickman.png') != None:
File "C:\Users\user\AppData\Local\Programs\Python\Python37\lib\site-packages\pyautogui_init_.py", line 174, in wrapper
raise ImageNotFoundException # Raise PyAutoGUI's ImageNotFoundException.
pyautogui.ImageNotFoundException

`

@0cheesecoder0
Copy link

I got the same error but quickly fixed it by using:
try:
find image
except pyautogui.ImageNotFoundException:
print("did not find")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants