Closed kiril22855 closed 6 months ago
The newer version of PyAutoGUI and PyScreeze will raise ImageNotFoundException
instead of returning None
when the image is not found.
Running setup.bat
in your terminal to downgrade the packages to the correct version should solve the problem.
If not, please paste the output of pip freeze
or pip list
here to help me identify your problem.
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:
in CMD use >pip freeze< to check your libraries versions. Unistall (you need to open CMD as an admin) >pip unistall Pillow< if version is not same as mentioned bellow. 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
That helped me
I just did a test by running pip install -r requirements.txt
on a new conda environment, everything works fine.
I think you may have installed some packages of the new version before running setup.bat
, causing some of the dependency checks to be ignored when installing the required packages.
You can use virtualenv or conda to create a virtual environment for a fresh installation to avoid this.
Here's the output of pip freeze
, hope it helps:
configparser==6.0.0
contourpy==1.2.1
cycler==0.12.1
EasyProcess==1.1
entrypoint2==1.1
fonttools==4.51.0
keyboard==0.13.5
kiwisolver==1.4.5
matplotlib==3.8.0
MouseInfo==0.1.3
mss==9.0.1
numpy==1.26.4
opencv-python==4.8.0.76
packaging==24.0
Pillow==10.0.0
playsound==1.2.2
prettytable==3.9.0
PTable==0.9.2
PyAutoGUI==0.9.54
PyGetWindow==0.0.9
PyMsgBox==1.0.9
pynput==1.7.6
pyparsing==3.1.2
pyperclip==1.8.2
PyRect==0.2.0
pyscreenshot==3.1
PyScreeze==0.1.29
python-dateutil==2.9.0.post0
python-dotenv==1.0.1
pytweening==1.2.0
pywin32==306
six==1.16.0
wcwidth==0.2.13
Do you want to continue with the settings above? [Y/n] y The bot has been started INFO: Casting INFO: Retrieving Traceback (most recent call last): File "C:\Users\Win10_Game_OS\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyautogui__init.py", line 172, in wrapper return wrappedFunction(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Win10_Game_OS\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyautogui\init.py", line 210, in locateOnScreen return pyscreeze.locateOnScreen(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Win10_Game_OS\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyscreeze\init.py", line 405, in locateOnScreen retVal = locate(image, screenshotIm, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Win10_Game_OS\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyscreeze\init.py", line 383, in locate points = tuple(locateAll(needleImage, haystackImage, **kwargs)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Win10_Game_OS\AppData\Local\Programs\Python\Python311\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.484)
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "C:\Users\Win10_Game_OS\Desktop\RussianFishing4Script-main\src\app.py", line 350, in
app.player.start_fishing()
File "C:\Users\Win10_Game_OS\Desktop\RussianFishing4Script-main\src\player.py", line 148, in start_fishing
self.spin_fishing()
File "C:\Users\Win10_Game_OS\Desktop\RussianFishing4Script-main\src\player.py", line 177, in spin_fishing
self.retrieving_stage()
File "C:\Users\Win10_Game_OS\Desktop\RussianFishing4Script-main\src\player.py", line 486, in retrieving_stage
while not self.tackle.retrieve(duration, delay, lift_enabled=self.lift_enabled):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Win10_Game_OS\Desktop\RussianFishing4Script-main\src\tackle.py", line 111, in retrieve
if monitor.is_line_at_end():
^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Win10_Game_OS\Desktop\RussianFishing4Script-main\src\monitor.py", line 103, in is_line_at_end
return locateOnScreen(fr'{parent_dir}spooling.png', confidence=0.98)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Win10_Game_OS\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyautogui__init__.py", line 174, in wrapper
raise ImageNotFoundException # Raise PyAutoGUI's ImageNotFoundException.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pyautogui.ImageNotFoundException