I try to locate an image on my screen. But it always shows this –
JavaScript
x
13
13
1
Traceback (most recent call last):
2
File "C:/Users/MerazulIslam/Desktop/ZOOM_BOT/bot.py", line 20, in <module>
3
find_btn = pyautogui.locateOnScreen(r'C:UsersMerazulIslamDesktopZOOM_BOTCapture.PNG', confidene=0.5)
4
File "C:UsersMerazulIslamAppDataRoamingPythonPython38site-packagespyautogui__init__.py", line 175, in wrapper
5
return wrappedFunction(*args, **kwargs)
6
File "C:UsersMerazulIslamAppDataRoamingPythonPython38site-packagespyautogui__init__.py", line 213, in locateOnScreen
7
return pyscreeze.locateOnScreen(*args, **kwargs)
8
File "C:UsersMerazulIslamAppDataRoamingPythonPython38site-packagespyscreeze__init__.py", line 359, in locateOnScreen
9
screenshotIm = screenshot(region=None) # the locateAll() function must handle cropping to return accurate coordinates, so don't pass a region here.
10
File "C:UsersMerazulIslamAppDataRoamingPythonPython38site-packagespyscreeze__init__.py", line 134, in wrapper
11
raise PyScreezeException('The Pillow package is required to use this function.')
12
pyscreeze.PyScreezeException: The Pillow package is required to use this function.
13
my code-
JavaScript
1
5
1
import pyautogui
2
3
find_btn = pyautogui.locateOnScreen(r'C:UsersMerazulIslamDesktopbotCapture.PNG')
4
print(find_btn)
5
Please help!
Advertisement
Answer
You can just try to reinstall pyautogui
with all dependencies to make sure nothing missing:
JavaScript
1
2
1
pip install --upgrade --force-reinstall pyautogui
2