Running psychopy in sudo mode

Hello, I’m trying to run PsychoPy in sudo mode on Ubuntu 22. I do that for using python-evdev or equivalent for locate from which specific keyboard key press (I got multiple keyboards on the same computer). For some reason I get sudo: psychopy: command not found when I try to simply run sudo psychopy and error (followed) where I try to run: sudo python3 psychopy-2024.2.4/psychopy/app/psychopyApp.py
Traceback (most recent call last): File "/home/tdl-linux/psychopy-2024.2.4/psychopy/app/psychopyApp.py", line 11, in <module> import psychopy.locale_setup # noqa ModuleNotFoundError: No module named 'psychopy'
I am pretty stuck here, there is any solution for this? or any other way to identify from which keyboard key pressed?

Does this post help?

Here is a thread about using two keyboards.

If you don’t want to fuss with making the root user work for your task (which is probably not a great idea anyway?), AFAICT PsychoPy’s keyboard exposes enough to ask for specific keyboards with the PTB backend? See here.

Hey just updating I just needed to add psychopy and current user to sudo group and its worked, thanks for everyone.