pyvisa / pyvisa-py

A pure python PyVISA backend
https://pyvisa-py.readthedocs.io
MIT License
288 stars 124 forks source link

PyUSB does not seem to be properly installed one one computer #384

Closed calugaruful-dotcom closed 1 year ago

calugaruful-dotcom commented 1 year ago

I have a python script I am running in pycharm and recently I am getting this error: ValueError: PyUSB does not seem to be properly installed.

I have ran this script on this computer before, and it worked. I usually install, libusb, pyvisa, pyvisa-py, pyusb packages and that seems to take care of the backend. For example, if I copy this same script and install the same packages on a different computer, it works and I get no error.

On the non working computer when I run pyvisa-info I can also see the usb backend is not configured: `PyVISA Version: 1.13.0

Backends: ivi: Version: 1.13.0 (bundled with PyVISA) Binary library: Not found py: Version: 0.7.0 TCPIP INSTR: Available Resource discovery:

arr-ee commented 1 year ago

All this message means is that usb.core.find() failed. Given that (I presume that) this is Windows (because you stripped out all system information from info output), I suspect that something is off with binary usb libraries.

Check https://github.com/pyusb/pyusb/blob/master/docs/faq.rst, especially the first two entries.

calugaruful-dotcom commented 1 year ago

This is the error output I am getting from usb.core.find()

2023-07-13 11:23:59,582 ERROR:usb.backend.libusb1:Error loading libusb 1.0 backend 2023-07-13 11:23:59,584 ERROR:usb.libloader:'Libusb 1' could not be found 2023-07-13 11:23:59,584 ERROR:usb.backend.libusb1:Error loading libusb 1.0 backend 2023-07-13 11:23:59,584 ERROR:usb.libloader:'OpenUSB library' could not be found 2023-07-13 11:23:59,584 ERROR:usb.backend.openusb:Error loading OpenUSB backend 2023-07-13 11:23:59,585 ERROR:usb.libloader:'Libusb 0' could not be found 2023-07-13 11:23:59,585 ERROR:usb.backend.libusb0:Error loading libusb 0.1 backend

Where is usb automatically looking for the libusb files? I understood it was system32 folder, and I put the .dlls there but that didn't work.

arr-ee commented 1 year ago

usb is pyusb, there is no pyvisa code there. This should help you find the answer or ask the question in the relevant project (where more people might have relevant knowledge).