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

[Bug] M2 Mac: usb exception: No backend available #460

Open
ericdude4 opened this issue Feb 12, 2023 · 4 comments
Open

[Bug] M2 Mac: usb exception: No backend available #460

ericdude4 opened this issue Feb 12, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@ericdude4
Copy link

ericdude4 commented Feb 12, 2023

Describe the bug
After following Mac install instructions (using asdf instead of pyenv) I am getting the following when running python3 nut_gui.py:

➜  nut git:(master) ✗ python3 nut_gui.py
loading blacklist /Users/foobar/Downloads/Switch/nut/conf/blacklist.online.txt
could not load find or load keys.txt, all crypto operations will fail. See keys_template.txt for an example of how this file should look
loaded user guest
                        ,;:;;,
                       ;;;;;
               .=\',    ;:;;:,
              /_\', "=. \';:;:;
              @=:__,  \,;:;:\'
                _(\.=  ;:;;\'
               `"_(  _/="`
                `"\'
loaded titledb/titles.json in 0.353336167 seconds
loaded file list in 0.0015640410000000715 seconds
initThread start
Sun Feb 12 12:36:48 2023 Server Starts - 0.0.0.0:9000
scanning /Users/foobar/Downloads/Switch
usb exception: No backend available
initThread finish
usb exception: No backend available
usb exception: No backend available
usb exception: No backend available
usb exception: No backend available
...

Regarding my libusb installation:

➜  nut git:(master) ✗ brew info libusb
==> libusb: stable 1.0.26 (bottled), HEAD
Library for USB device access
https://libusb.info/
/opt/homebrew/Cellar/libusb/1.0.26 (22 files, 595KB) *
  Poured from bottle on 2023-02-12 at 12:29:18
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/libusb.rb
License: LGPL-2.1-or-later

To Reproduce
Steps to reproduce the behaviour:

asdf install python 3.9.7
asdf local python 3.9.7
brew install pyqt@5
brew install libusb
cd /Users/foobar/.asdf/installs/python/3.9.7/lib/python3.9/site-packages && echo "/opt/homebrew/lib/python3.9/site-packages" >> homebrew.pth
pip install wheel
PYCURL_SSL_LIBRARY=openssl LDFLAGS="-L/opt/homebrew/opt/openssl/lib" CPPFLAGS="-I/opt/homebrew/opt/openssl/include" pip install pycurl
pip install -r requirements.txt
python3 nut_gui.py

Actual behaviour
The application launches and behaves normally, but isn't able to recognize libusb.

Expected behaviour
libusb is recognized as usb backend

Screenshots
If applicable, add screenshots to help explain your problem.

NUT version (or git hash):

Additional context
Running on M2 Max

@ericdude4 ericdude4 added the bug Something isn't working label Feb 12, 2023
@Yamilquery
Copy link

Yamilquery commented Feb 24, 2023

I had the same error on M1 Max:

loaded user guest
                        ,;:;;,
                       ;;;;;
               .=\',    ;:;;:,
              /_\', "=. \';:;:;
              @=:__,  \,;:;:\'
                _(\.=  ;:;;\'
               `"_(  _/="`
                `"\'
loaded titledb/titles.json in 0.399159458 seconds
loaded file list in 0.001259416999999985 seconds
initThread start
Fri Feb 24 16:01:57 2023 Server Starts - 0.0.0.0:9000
scanning .
usb exception: No backend available
initThread finish                                                                                                                           
usb exception: No backend available
usb exception: No backend available
usb exception: No backend available
usb exception: No backend available

You can solve it with:

ln -s /opt/homebrew/lib/libusb-1.0.0.dylib /usr/local/lib/libusb.dylib

Enjoy

@renb0
Copy link

renb0 commented May 2, 2023

I had the same error on M1 Max:

loaded user guest
                        ,;:;;,
                       ;;;;;
               .=\',    ;:;;:,
              /_\', "=. \';:;:;
              @=:__,  \,;:;:\'
                _(\.=  ;:;;\'
               `"_(  _/="`
                `"\'
loaded titledb/titles.json in 0.399159458 seconds
loaded file list in 0.001259416999999985 seconds
initThread start
Fri Feb 24 16:01:57 2023 Server Starts - 0.0.0.0:9000
scanning .
usb exception: No backend available
initThread finish                                                                                                                           
usb exception: No backend available
usb exception: No backend available
usb exception: No backend available
usb exception: No backend available

You can solve it with:

ln -s /opt/homebrew/lib/libusb-1.0.0.dylib /usr/local/lib/libusb.dylib

Enjoy

Worked for me too, thanks!

@matthewperiut
Copy link

I'm not sure why but here's what I did to fix it:

sudo mkdir /usr/local/lib
sudo ln -s /opt/homebrew/Cellar/libusb/1.0.27/lib/libusb-1.0.0.dylib /usr/local/lib/libusb.dylib

and that worked!

@Jonathan0212
Copy link

I'm not sure why but here's what I did to fix it:

sudo mkdir /usr/local/lib sudo ln -s /opt/homebrew/Cellar/libusb/1.0.27/lib/libusb-1.0.0.dylib /usr/local/lib/libusb.dylib

and that worked!

I have that folder already created and the command still does not work. Im on a M1 pro. I keep getting file exist..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants