-
Notifications
You must be signed in to change notification settings - Fork 42
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
Library lookup doesn't work with custom path #50
Comments
libhidapi must appear on your system library path - if you don't want to
permanently modify your system you can temporarily add `/opt/brew/lib` to
LD_LIBRARY_PATH before running qmk.
```
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/brew/lib
qmk compile
```
…On Mon, Jun 28, 2021, 08:13 Damien Pollet ***@***.***> wrote:
I have hidapi installed via brew <https://brew.sh> under a custom prefix:
$ ls -l /opt/brew/lib/libhidapi*
lrwxr-xr-x 1 damien admin 45 Jun 13 19:25 /opt/brew/lib/libhidapi.0.dylib -> ../Cellar/hidapi/0.10.1/lib/libhidapi.0.dylib
lrwxr-xr-x 1 damien admin 39 Jun 13 19:25 /opt/brew/lib/libhidapi.a -> ../Cellar/hidapi/0.10.1/lib/libhidapi.a
lrwxr-xr-x 1 damien admin 43 Jun 13 19:25 /opt/brew/lib/libhidapi.dylib -> ../Cellar/hidapi/0.10.1/lib/libhidapi.dylib
That breaks qmk <https://qmk.fm> because it can't find it.
$ qmk compile
Error: %s: %s ('ImportError', ImportError('Unable to load any of the following libraries:libhidapi-hidraw.so libhidapi-hidraw.so.0 libhidapi-libusb.so libhidapi-libusb.so.0 libhidapi-iohidmanager.so libhidapi-iohidmanager.so.0 libhidapi.dylib hidapi.dll libhidapi-0.dll'))
Traceback (most recent call last):
File "/opt/brew/Cellar/qmk/0.1.0/libexec/lib/python3.9/site-packages/qmk_cli/script_qmk.py", line 76, in main
import qmk.cli # noqa
File "/Users/damien/Repositories/custom-keyboards/qmk_firmware/lib/python/qmk/cli/__init__.py", line 191, in <module>
__import__(subcommand)
File "/Users/damien/Repositories/custom-keyboards/qmk_firmware/lib/python/qmk/cli/console.py", line 9, in <module>
import hid
File "/opt/brew/Cellar/qmk/0.1.0/libexec/lib/python3.9/site-packages/hid/__init__.py", line 30, in <module>
raise ImportError(error)
ImportError: Unable to load any of the following libraries:libhidapi-hidraw.so libhidapi-hidraw.so.0 libhidapi-libusb.so libhidapi-libusb.so.0 libhidapi-iohidmanager.so libhidapi-iohidmanager.so.0 libhidapi.dylib hidapi.dll libhidapi-0.dll
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#50>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAPRFDAKXJMPDWMZVWOKWDTVBROLANCNFSM47N24SQA>
.
|
I had tried that before with |
When setting
The path can be set from Python before attempting to load the library, like so: import os
os.environ['DYLD_LIBRARY_PATH'] = '/opt/homebrew/lib'
import hid Ugly, but it works. The alternative seems to be to disable SIP on the machine, which doesn't seem like a good idea at all. |
I have
hidapi
installed viabrew
under a custom prefix:That breaks
qmk
because it can't find it.The text was updated successfully, but these errors were encountered: