Closed JackLawrenceCRISPR closed 1 year ago
The root cause of the incompatibility: https://www.raspberrypi.com/news/bookworm-the-new-version-of-raspberry-pi-os/
"the move to using Wayland rather than X11 as the display system."
PyAutoGui (and Mouse) use X11 api for their linux support.
As such, the issue is addressed in the following thread: https://github.com/asweigart/pyautogui/issues/111
I redirect any further discussion regarding piOS or Debian 12.0>= compatibility to the aforementioned Wayland support thread.
The Wayland support thread offer some potential alternatives to pyautogui and mouse functions. Some users in the thread have suggested the following modules: evemu, python-evdev, keyboard, ydotool. Please read the aforementioned thread for further discussion about the features and limitations of each module.
See previous comment.
Pyautogui does not function on the latest raspberry piOS based on Debian Bookworm. I've only tested the piOS, but other Debian Bookworm releases may share the same issue. Pyautogui did work on Debian Bullseye.
Steps to replicate:
You can also do the following :
Problems also persist with pip3.
Mouse movement, clicks and identify position do not function: nothing happens but no errors are raised.
Position will always be 0,0 (or 500,500 depending on your setup). This issue also affects another mouse module https://pypi.org/project/mouse/ with identical results for their "mouse.get_position".