When running the pyautogui.locateOnScreen() function it gives me the following error:
scrot: invalid option -- 'z'
Does anyone know why this might be happening?
I have scrot 0.8 installed and just running scrot a.png
in the terminal works just fine. Running scrot -z
gives the samescrot: invalid option -- 'z'
error message.
Any help is appreciated.
You can safely ignore it, or if it bothers you, fork or submit a PR to pyscreeze.
pyautogui depends on the pyscreeze package to take cross-platform screenshots. On Linux, pyscreeze uses a command-line utility called scrot.
When pyscreeze shells out to scrot, it passes -z
. This specifies Prevent beeping
in some versions of scrot, but isn't always available. For instance, it's missing in Fedora's scrot-0.8-21.fc31.x86_64
.
But invalid option -- 'z'
isn't a fatal error. You can verify this by running $ scrot -z
and seeing that a new timestamped screenshot appears in your working directory, despite the message. Or from Python, call subprocess.call(['scrot', '-z'])
, and see that the return code is 0
.