Search code examples
pythonwindowsusblibusbpyusb

Pyusb/libusb0 insufficient permissions Windows


I want to read out a USB measurement device in python. For this I use the usbtmc module. It requires Pyusb and libusb-win32. I installed both and it seems that they are running fine. In the device manager I can find my USB device. And in python too. For example:

import usbtmc
dev = usbtmc.list_devices()
print(dev)

It returns the right device.

But when I want to connect to it:

instr =  usbtmc.Instrument(2391, 11288)
print(instr.ask("*IDN?"))

I get following error message:

File "C:\Users\Elektroniklabor\Anaconda3\lib\site-packages\usb\backend\libusb10.py", line 403, in _check
raise USBError(_str_error[ret], ret, _libusb_errno[ret])
usb.core.USBError: [Errno 13] Access denied (insufficient permissions)

Has anyone an idea how to solve this problem?


Solution

  • The Keysight support helped me out: I had to install the Keysight drivers (connection expert) and the pyvisa and pyvisa-py module. It is now working!