Python Keyboard Module - import not working

807 Views Asked by At

I'm trying to use the keyboard module, but when I import it, I'm receiving a problem.

import keyboard

However, I get this error

     File "c:/Users/P/Code/test.py", line 1, in <module>
        import keyboard
      File "C:\Users\P\AppData\Local\Programs\Python\Python37\lib\site-packages\keyboard\__init__.py", line 296, in <module>
        _listener = _KeyboardListener()
      File "C:\Users\P\AppData\Local\Programs\Python\Python37\lib\site-packages\keyboard\_generic.py", line 17, in __init__
        self.queue = Queue()
    TypeError: __init__() missing 1 required positional argument: 'items'

Could someone please help me understand where I'm going wrong?

1

There are 1 best solutions below

1
On

It looks like the import needs another argument, which is pretty unusual.