Skip to content

[support] I get "all backends failed" after a while - any tips? #98

@lowfuel

Description

@lowfuel

Should start by saying I only really know enough to be dangerous re: python and linux.

I've written a script that uses pyscreenshot to take a full screen screenshot every second or so, do some processing, then repeat.
This works great for maybe ten or fifteen minutes, but after that I start I get "all backends failed" on each attempt, and it never recovers.

I'm sure this is just something wonky with my OS and/or Window Manager (CachyOS based on Arch, and Wayland).

What I'm wonder is if there's some way to sort of reboot pyscreenshot from within my script? Right now I have to control-C it and start it fresh.

Thanks for any tips!

My code isn't complicated, here's the relevant bits:
import pyscreenshot as ImageGrab

img = ImageGrab.grab()
np_img = cv2.cvtColor(np.array(img), cv2.COLOR_BGR2GRAY)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions