Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined_symbol: hid_enumerate #18

Closed
matmunn opened this issue Feb 8, 2019 · 3 comments
Closed

undefined_symbol: hid_enumerate #18

matmunn opened this issue Feb 8, 2019 · 3 comments

Comments

@matmunn
Copy link

matmunn commented Feb 8, 2019

Trying to run ./certtool init is throwing the following errors:

Traceback (most recent call last):
  File "./certtool", line 139, in <module>
    main()
  File "./certtool", line 136, in main
    args.func(args)
  File "./certtool", line 102, in command_init
    e = easyhid.Enumeration()
  File "/home/server/Dev/venv/lib/python3.7/site-packages/easyhid/easyhid.py", line 358, in __init__
    self.device_list = _hid_enumerate(vid, pid)
  File "/home/server/Dev/venv/lib/python3.7/site-packages/easyhid/easyhid.py", line 420, in _hid_enumerate
    start = hidapi.hid_enumerate(vendor_id, product_id)
  File "/home/server/Dev/venv/lib/python3.7/site-packages/cffi/api.py", line 882, in __getattr__
    make_accessor(name)
  File "/home/server/Dev/venv/lib/python3.7/site-packages/cffi/api.py", line 878, in make_accessor
    accessors[name](name)
  File "/home/server/Dev/venv/lib/python3.7/site-packages/cffi/api.py", line 808, in accessor_function
    value = backendlib.load_function(BType, name)
AttributeError: function/symbol 'hid_enumerate' not found in library '<None>': python: undefined symbol: hid_enumerate
(venv) [server@server cert]$ sudo ./certtool init
Traceback (most recent call last):
  File "./certtool", line 139, in <module>
    main()
  File "./certtool", line 136, in main
    args.func(args)
  File "./certtool", line 102, in command_init
    e = easyhid.Enumeration()
  File "/home/server/Dev/venv/lib/python3.7/site-packages/easyhid/easyhid.py", line 358, in __init__
    self.device_list = _hid_enumerate(vid, pid)
  File "/home/server/Dev/venv/lib/python3.7/site-packages/easyhid/easyhid.py", line 420, in _hid_enumerate
    start = hidapi.hid_enumerate(vendor_id, product_id)
  File "/home/server/Dev/venv/lib/python3.7/site-packages/cffi/api.py", line 882, in __getattr__
    make_accessor(name)
  File "/home/server/Dev/venv/lib/python3.7/site-packages/cffi/api.py", line 878, in make_accessor
    accessors[name](name)
  File "/home/server/Dev/venv/lib/python3.7/site-packages/cffi/api.py", line 808, in accessor_function
    value = backendlib.load_function(BType, name)
AttributeError: function/symbol 'hid_enumerate' not found in library '<None>': python: undefined symbol: hid_enumerate

I've tried on both macOS 10.12.6 and a Linux system running kernel 4.20.6. As far as I can tell I've installed all the dependencies required, I've also tried Python 3.6.8 and 3.7.2

@gl-sergei
Copy link
Owner

It looks like easy_hid package cannot find hidapi library. This library is available as brew formula on OS X and as a package on debian/ubuntu.

@matmunn
Copy link
Author

matmunn commented Feb 8, 2019

Yep, that was the problem. Seems to be all good now, thanks for that

@matmunn matmunn closed this as completed Feb 8, 2019
azrdev added a commit to azrdev/u2f-token that referenced this issue May 15, 2019
Got bitten by gl-sergei#18 on archlinux because I installed `python-hidapi` instead of `hidapi`, therefore proposing to include package names for distros other than ubuntu.
@V3ntus
Copy link

V3ntus commented Oct 21, 2022

I'm having this issue as well, although I've followed instructions with installing hidapi with brew. I've unlinked and relinked it as well. Using Python 3.10. Not sure where to start with troubleshooting, I assume it's still a path problem

Mac OS Catalina

  1. Installing through port didn't work
  2. Specifying DYLD_LIBRARY_PATH to point to the libhidapi.dylib directory before the command didn't work

Edit: just switched to Linux and it worked

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants