Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23189

Can't run pyautogui on ubuntu

$
0
0

i want to use Pyautogui and Keyboard module at the same time (Using Python), but i can't do that. i have installed Keyboard module and Pyautogui module too, but when i try to run Pyautogui via root i get this error (sudo python3)

    raise error.DisplayConnectionError(self.display_name, r.reason)Xlib.error.DisplayConnectionError: Can't connect to display ":1": b'Authorization required, but no authorization protocol specified\n'

without root, it works. but keyboard doesn't work without root.

    raise ImportError('You must be root to use this library on linux.')ImportError: You must be root to use this library on linux.

I am using .is_pressed() function in keyboard module.


Viewing all articles
Browse latest Browse all 23189

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>