gpt4 book ai didi

python - 尽管安装了所需的库(在 ubuntu 上使用 python3),但 Pyautogui 函数 LocateOnScreen 仍然出错。请帮帮我

转载 作者:行者123 更新时间:2023-12-04 19:29:31 29 4
gpt4 key购买 nike

解释器中使用的函数:

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() .

关于python - 尽管安装了所需的库(在 ubuntu 上使用 python3),但 Pyautogui 函数 LocateOnScreen 仍然出错。请帮帮我,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68037482/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com