Python module "keyboard" works on Windows, not found on Raspberry

12,212

You need to check which interpreter your pip is installing packages to.

You have both Python2 and Python3 installed on your PI, so only one of these will have access to the packages you are installing with pip.

You can check which interpreter your pip is installing packages to by running the following commands:

[root@pi] python2 -m pip list
[root@pi] python3 -m pip list

If pip is installing the packages to your Python2 installation, you will need to explicitly call the Python3 interpreter when installing the packages

[root@pi] python3 -m pip install keyboard
Share:
12,212
Scott Free VT
Author by

Scott Free VT

Updated on July 06, 2022

Comments

  • Scott Free VT
    Scott Free VT almost 2 years

    I want to use module keyboard in Python 3.5.3.

    pip, import and my program work fine on Windows. On my Raspberry pip install works and pip list shows keyboard.

    However when I try to run import keyboard I get the error: "ImportError: No module named 'keyboard'"

    I even tried to use sudo import as the keyboard documentation suggests with the same result.

    What am I missing?