L
L
leviathan2020-05-31 22:20:17
Python
leviathan, 2020-05-31 22:20:17

Why does pyautogui fall off if I run the script via systemctl?

The script uses the pyautogui module and takes screenshots on request. I added it to systemd, ran it, and the output was with an error:

screen
5ed402d49f4a1799165679.png

Is it possible to win somehow without changing the module to another one?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
AveWycc, 2020-05-31
@AveWycc

There is no ['DISPLAY'' key in os.environ, look for an error in this.
UPD: Try writing os.environ['DISPLAY'] = ':0' in your code

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question