2

could not use module keyboard, i have check using python3 -m pip list to check the pip packages that i have installed and i saw that i have installed keyboard 0.13.5 , however after i execute this code

import keyboard

shortcut = 'alt+x'
good = 'shift+a'
def on_triggered():
    print('hi')

keyboard.add_hotkey(shortcut,on_triggered)
keyboard.add_hotkey(good,on_triggered)

keyboard.wait('esc') 

i still get this error ModuleNotFoundError: No module named 'keyboard'

even if i have install the module with this code python3 -m pip install keyboard and this code pip3 install keyboard. please help me i am using raspberry pi zero with python version 3.7.3

btw this work on window 10 but it does not work on raspberry pi zero.

i have check other question and follow their instruction by installing with python3 -m pip install, but nothing changed.

this is what it said after i install

Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: keyboard in /home/pi/.local/lib/python3.7/site-packages (0.13.5)
al de
  • 63
  • 5

0 Answers0