No backend error

I am a newbie Odrive user having trouble getting started. My Odrive 3.6-56V is powered with 44.4V, and the LED is on. It is connected via the provided USB cable to my laptop PC (Lenovo), running Windows 10 Home (20H2). It appears in Device Manager as COM10 under Ports, and as “Odrive 3.6 Native Interface” under Universal Serial Bus devices. Properties for the later confirm WinUSB is the driver.
I have a fresh local install of Python3.8.6. i used pip on that installation to add the odrivetool, which now appears in the Python/Scripts folder.

When i launch odrivetool it fails to find and connect to the Odrive. For some reason it is unable to select and USB backend. lib/site-packages/usb is present, including and a /backend folder.
It appears i have version 0.5.1.pos0 of the odrivetool.

ODrive control utility v0.5.1.post0
Discord: in thread

Traceback (most recent call last):

Please connect your ODrive.
  File "c:\programs\Odrive\Python3.8.6\lib\", line 932, in _bootstrap_inner
You can also type help() or quit().
  File "c:\programs\Odrive\Python3.8.6\lib\", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "c:\programs\Odrive\Python3.8.6\lib\site-packages\fibre\", line 191, in discover_channels
    devices = usb.core.find(find_all=True, custom_match=device_matcher)
  File "c:\programs\Odrive\Python3.8.6\lib\site-packages\usb\", line 1309, in find
    raise NoBackendError('No backend available')
usb.core.NoBackendError: No backend available
In [1]:

–verbose does not add anything useful.
Can anyone give me a clue about what is wrong, or about what else i might try ?
Grateful in advance.

I figured i would share my own answer to this issue.
Odrivetool has a dependency on the PyUSB package which IS reflected in its install chain. So the PyUSB package was installed. However, PyUSB has a dependency upon the libUSB package which
IS NOT reflected in its install chain. So the libUSB package did NOT get installed. It is this package which is referred to as the USB “backend”.
So Odrivetool fails to find a code file it needs, and raises an exception. I also noted that the PyUSB package implements a load_library() function that depends upon the PATH environment variable (tells it in which directories to look for the file). I am adamant against using environment variables in SW
packages - guaranteed reliability problems. So i googled “Python USB libraries” to learn. Sure enough “no backend” is a common problem, with a half dozen offered solutions accumulated over a decade. So i manually installed the libUSB package (pip libUSB), which got the proper backend utility file on my system. I chose to move a copy of it to a directory already in my PATH. With this i made progress beyond the failure, and on to the next.

1 Like

If you install python3-usb with apt instead of ‘pip’ then it will pull in libusb, fyi.
Pip can’t install ‘system’ packages like libusb.

Glad you got it sorted.

1 Like

I am not aware of apt working on Windows 10, which is my environment. But the distinction of ‘system packages’ is good to be made aware of - i was not previously.

Maybe the install log included a warning message about the need for libUSB and i just missed it in the noise. But this seems like an obvious hole into which many (not just me) will fall. Odrive docs have a section for Windows. I saw nothing about this dependency there either.

1 Like

Boo :-1: :stuck_out_tongue_closed_eyes:

Seriously though, Windows kernel USB support for composite devices is utterly horrible, to the point where you need 3rd-party utilities like Zadig to force it to use a particular driver, when Linux can use multiple drivers at once for a composite device.

If you’re using Python and USB (or CAN), it’s better to do it via a Raspberry Pi if you don’t have/want native Linux on your workstation itself.