You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While running the script capture_images_by_key.py from the examples folder, I encountered the following error:
In main
if is_pressed('p'):
File "/home/user/.local/lib/python3.9/site-packages/keyboard/__init__.py", line 410, in is_pressed
_listener.start_if_necessary()
File "/home/user/.local/lib/python3.9/site-packages/keyboard/_generic.py", line 35, in start_if_necessary
self.init()
File "/home/user/.local/lib/python3.9/site-packages/keyboard/__init__.py", line 196, in init
_os_keyboard.init()
File "/home/user/.local/lib/python3.9/site-packages/keyboard/_nixkeyboard.py", line 113, in init
build_device()
File "/home/user File "/home/user/.local/lib/python3.9/site-packages/keyboard/_nixcommon.py", line 174, in ensure_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 understand that the Picamera2 team cannot do much about the privileges for running the keyboard package (that was installed via pip without elevated privileges), is there an alternative package for evaluation purposes. After all, we routinely use similar examples in OpenCV without elevated privileges (cv2.waitKey(wait_period) since it is baked into OpenCV). What would be an alternate package for consideration by a newbie user without needing elevated privileges? Thanks.
Regards.
P.S.
The user identified as user in the above section has admin rights on the computer.
Example 1:
import pynput.keyboard as keyboard
def on_press(key):
print('The key {} was pressed.'.format(key))
Example 2:
import msvcrt
if msvcrt.kbhit():
key = msvcrt.getch()
print('The key {} was pressed.'.format(key))
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
While running the script capture_images_by_key.py from the examples folder, I encountered the following error:
I understand that the Picamera2 team cannot do much about the privileges for running the keyboard package (that was installed via pip without elevated privileges), is there an alternative package for evaluation purposes. After all, we routinely use similar examples in OpenCV without elevated privileges (cv2.waitKey(wait_period) since it is baked into OpenCV). What would be an alternate package for consideration by a newbie user without needing elevated privileges? Thanks.
Regards.
P.S.
The user identified as user in the above section has admin rights on the computer.
Example 1:
Example 2:
Beta Was this translation helpful? Give feedback.
All reactions