[英]How can I make pyautogui tell me the coordinates of the locateOnScreen function
[英]Pyautogui function LocateOnScreen is giving error despite having installed required library(using python3 on ubuntu).Please help me out
解釋器中使用的函數:
pyautogui.locateOnScreen('zoom_pic.png')
錯誤是:-
Traceback (most recent call last):
File "<pyshell#10>", line 1, in <module>
pyautogui.locateOnScreen('zoom_pic.png')
File "/home/aaryan/.local/lib/python3.8/site-packages/pyautogui/__init__.py", line 175, in wrapper
return wrappedFunction(*args, **kwargs)
File "/home/aaryan/.local/lib/python3.8/site-packages/pyautogui/__init__.py", line 213, in locateOnScreen
return pyscreeze.locateOnScreen(*args, **kwargs)
File "/home/aaryan/.local/lib/python3.8/site-packages/pyscreeze/__init__.py", line 371, in locateOnScreen
screenshotIm = screenshot(region=None) # the locateAll() function must handle cropping to return accurate coordinates, so don't pass a region here.
File "/home/aaryan/.local/lib/python3.8/site-packages/pyscreeze/__init__.py", line 498, in _screenshot_linux
raise NotImplementedError('"scrot" must be installed to use screenshot functions in Linux. Run: sudo apt-get install scrot')
NotImplementedError: "scrot" must be installed to use screenshot functions in Linux. Run: sudo apt-get install scrot
錯誤消息說:
"scrot" must be installed to use screenshot functions in Linux. Run: sudo apt-get install scrot
您是否在終端中嘗試過sudo apt-get install scrot
? 這應該允許您運行pyautogui.locateOnScreen()
和pyautogui.screenshot()
等函數。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.