我也安装了键盘模块和Pyautogui模块,但是当我尝试通过root运行Pyautogui时,我得到了这个错误(sudo python3)。raise ImportError('You must be root to use this library on linux.')ImportError: You must be root to use this library on linux.
我在键盘模块中使用.is_pressed()函数。
key_press(key):keyboard.on_press(key_press)...
line 174, in ensure_rootraise ImportError('You must be root to use this library on linux.')ImportError: You must be root to use this library on linux.当然,我需要没有ro
我尝试以root用户身份和使用sudo命令运行它,结果相同。下面是代码和错误。home/pi/.local/lib/python3.5/site-packages/keyboard/_nixkeyboard.py", line 106, in build_deviceFile "/home/pi/.local/lib/python3.5/site-packages/key