apmorton/pyhidapi

still get error with hid_get_input_report when using 1.0.5

allenz92 opened this issue · 2 comments

Ubuntu 20.04.4 LTS
python3.8

root@jmx-desktop:/home/jmx# pip list | grep hid
hid 1.0.5

Here is my stack trace:

import hid
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python3.8/dist-packages/hid/init.py", line 83, in
hidapi.hid_get_input_report.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_size_t]
File "/usr/lib/python3.8/ctypes/init.py", line 386, in getattr
func = self.getitem(name)
File "/usr/lib/python3.8/ctypes/init.py", line 391, in getitem
func = self._FuncPtr((name_or_ordinal, self))
AttributeError: /lib/aarch64-linux-gnu/libhidapi-hidraw.so.0: undefined symbol: hid_get_input_report

This indicates your version of the native libhidapi is too old.

hid_get_input_report is a fairly recent addition to libhidapi, so it isn't surprising.

You need to update your native library, and then pyhidapi should work.

@allenz92 If you're on 20.04, then apt is serving you version 0.9 of libhidapi. I'm still working out myself whether it's possible to pull a newer version or build it from source, or if I'll need to fully upgrade to 22.04 to get it.