0

I get this error when i try to import pynput to control my motor using keyboard:

Traceback (most recent call last):
  File "/home/pi/.local/lib/python3.5/site-packages/Xlib/display.py", 
line 224, in __getattr__
    function = self.display_extension_methods[attr]
KeyError: 'ge_add_event_data'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    import pynput
  File "/home/pi/.local/lib/python3.5/site-packages/pynput/__init__.py", 
line 23, in <module>
    from . import keyboard
  File "/home/pi/.local/lib/python3.5/site- 
packages/pynput/keyboard/__init__.py", line 49, in <module>
    from ._xorg import KeyCode, Key, Controller, Listener
  File "/home/pi/.local/lib/python3.5/site- 
 packages/pynput/keyboard/_xorg.py", line 39, in <module>
   from pynput._util.xorg import (
  File "/home/pi/.local/lib/python3.5/site- 
packages/pynput/_util/xorg.py", line 40, in <module>
    _check()
  File "/home/pi/.local/lib/python3.5/site- 
 packages/pynput/_util/xorg.py", line 38, in _check
    display = Xlib.display.Display()
  File "/home/pi/.local/lib/python3.5/site-packages/Xlib/display.py", 
line 127, in __init__
    mod.init(self, info)
  File "/home/pi/.local/lib/python3.5/site-packages/Xlib/ext/xinput.py", 
line 652, in init
    disp.ge_add_event_data(info.major_opcode, device_event, 
DeviceEventData)
  File "/home/pi/.local/lib/python3.5/site-packages/Xlib/display.py", 
line 227, in __getattr__
    raise AttributeError(attr)
AttributeError: ge_add_event_data

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.