我正在尝试使用PyAutoGUI库使计算机自动单击
在Online IDE Repl.it中显示KeyError: 'DISPLAY'
,尽管我正确导入了pyautogui程序包。请问该如何解决?帮助。
当我在终端中尝试时,它运行良好,并且在Repl.it中,我在requirment.text中正确导入了pyautogui程序包,但仍然出现错误
import pyautogui
import time
i = 0
while i<20:
pyautogui.click(42, 756)
time.sleep(1)
i += 1
File "/home/runner/.local/lib/python3.6/site-packages/pyautogui/_pyautogui_x11.py", line 161, in <module>
_display = Display(os.environ['DISPLAY'])
File "/usr/local/lib/python3.6/os.py", line 669, in __getitem__
raise KeyError(key) from None
KeyError: 'DISPLAY'