How to fix Python ModuleNotFoundError: No module named 'usb' / usb.util
Problem:
When running a Python script, you see an error message like
Traceback (most recent call last):
File "./dfuse-tool.py", line 2, in <module>
import dfuse
File "/home/uli/dev/tools/dfuse-tool/dfuse/__init__.py", line 1, in <module>
from dfuse.DfuDevice import DfuDevice
File "/home/uli/dev/tools/dfuse-tool/dfuse/DfuDevice.py", line 1, in <module>
import usb.util
ModuleNotFoundError: No module named 'usb'
Solution
You need to install PyUSB using
sudo pip3 install pyusb