Wie man PyVISA ValueError repariert: Please install PyUSB to use this resource type

Problem:

Beim Versuch, ein Python-Skript mit PyVISA mit einem USB-Instrument auszuführen, sehen Sie die folgende Fehlermeldung:

pyvisa_error.txt
ValueError: Please install PyUSB to use this resource type.
No module named 'usb'

Lösung

Auf Linux-Distributionen wie Ubuntu können Sie dies mit

install_pyusb.sh
sudo apt-get -y install python3-usb

reparieren. Dies installiert das Python3-usb-Paket und die libusb-Systempakete.


Check out similar posts by category: Python