Python module "keyboard" works on Windows, not found on Raspberry
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
Scott Free VT
Updated on July 06, 2022Comments
-
Scott Free VT almost 2 years
I want to use module
keyboard
inPython 3.5.3
.pip
,import
and my program work fine onWindows
. On my Raspberrypip install
works andpip list
showskeyboard
.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?