iIndrasura/apexAFKfarmbot

i keep getting this what do i do to fix it

hacker0529 opened this issue · 1 comments

File "C:\Users\oxeyt\AppData\Local\Programs\Python\Python312\Lib\site-packages\pyautogui_init_.py", line 172, in wrapper
return wrappedFunction(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\oxeyt\AppData\Local\Programs\Python\Python312\Lib\site-packages\pyautogui_init_.py", line 210, in locateOnScreen
return pyscreeze.locateOnScreen(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\oxeyt\AppData\Local\Programs\Python\Python312\Lib\site-packages\pyscreeze_init_.py", line 405, in locateOnScreen
retVal = locate(image, screenshotIm, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\oxeyt\AppData\Local\Programs\Python\Python312\Lib\site-packages\pyscreeze_init_.py", line 383, in locate
points = tuple(locateAll(needleImage, haystackImage, **kwargs))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\oxeyt\AppData\Local\Programs\Python\Python312\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.217)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\oxeyt\Downloads\ApexFarming-main\ApexFarmer.py", line 10, in
if pyautogui.locateOnScreen('ManuNotReady.png', region=(0,538,447,528), grayscale=True, confidence=0.7) != None:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\oxeyt\AppData\Local\Programs\Python\Python312\Lib\site-packages\pyautogui_init_.py", line 174, in wrapper
raise ImageNotFoundException # Raise PyAutoGUI's ImageNotFoundException.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pyautogui.ImageNotFoundException

GromeQ commented

So I was fighting with this error over 10 hours. And I have found the problem...
Libraries of Pillow / pyScreeze do not install to the newest version and this is only one way now to go around it:

  1. in CMD use >pip freeze< to check your libraries versions.
  2. Unistall (you need to open CMD as an admin) >pip unistall Pillow< if version is not same as mentioned bellow.
  3. Install proper and working libraries like mentioned bellow >pip install PyScreeze==0.1.28<

Pillow==9.3.0
PyAutoGUI==0.9.53
PyScreeze==0.1.28