Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pyautogui does not function on the latest raspberry piOS (Debian Bookworm) #820

Closed
JackLawrenceCRISPR opened this issue Oct 26, 2023 · 2 comments

Comments

@JackLawrenceCRISPR
Copy link

JackLawrenceCRISPR commented Oct 26, 2023

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:

  1. Flash a fresh standard full x64 Bookworm based piOS released 10-10-2023 and setup.
  2. Create a python venv and activate it
  3. pip install pyautogui
  4. python
  5. import pyautogui
  6. pyautogui.position() -> (0,0)

You can also do the following :

  1. After a fresh install, run "sudo rm /usr/lib/python3.11/EXTERNALLY-MANAGED" to disable pip protection (please don't do this if you intend to keep using your piOS installation afterwards)
  2. sudo pip install pyautogui
  3. sudo python
  4. import pyautogui
  5. pyautogui.position() -> (0,0)

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".

@JackLawrenceCRISPR
Copy link
Author

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:
#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.

@JackLawrenceCRISPR
Copy link
Author

See previous comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant