簡體   English   中英

盡管已安裝所需的庫(在 ubuntu 上使用 python3),Pyautogui 函數 LocateOnScreen 仍出錯。請幫幫我

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM