In python 3.6 I could say:

import keyboard

but in python 3.7 it gives me the error message saying: no module named 'keyboard'

Is this module gone or has it been renamed?

3 Answers

TigerhawkT3 On

That is not part of the standard library. You have to install it separately for each version of Python that you use.

Community On

Because you did not install this module in your Python 3.7 environment. you can check pip list and pip install keyboard to use it.

Python 3.7.2 (tags/v3.7.2:9a3ffc0492, Dec 23 2018, 22:20:52) [MSC v.1916 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> ^Z

C:\Users\TR>pip install keyboard
Collecting keyboard
  Downloading (58kB)
     |████████████████████████████████| 61kB 178kB/s
Installing collected packages: keyboard
Successfully installed keyboard-0.13.3
dhruv patel On

It is not gone but as it is not part of built-in modules in python 3.7, you have to explicitly install it by :

pip install keyboard.