Pyusb on Windows 7 cannot find any devices

你说的曾经没有我的故事 提交于 2019-12-06 05:51:39

问题


So I installed Pyusb 1.0.0-alpha-1
Under Windows, I cannot get any handles to usb devices.

>>> import usb.core
>>> print usb.core.find()
None

I do have 1 usb device plugged in(idVendor=0x04d8, idProduct=0x0042), and I tried usb.core.find(idVendor=0x04d8, idProduct=0x0042) but that failed too.

Under Ubuntu, with the same versions of pyusb and python (2.6), I am able to successfully find my device with that code, and communicate with it.

So how can I get pyusb to find usb devices on Windows 7?


回答1:


Libusb requires you to install a special driver for every device you want to use it with. That usually requires you to write an .inf file containing the USB IDs of the device. Only if the driver and inf file are installed libusb will be able to "see" your device.




回答2:


See Turbo J's answer. To install the USB driver libusb for your device I found two options:

  • Use libusb-win32's inf-wizard.exe to create the INF file and then use install-filter-win.exe to install libusb as driver for your device.

  • Use zadig (simpler)

    • if no device is shown, Options > List All Devices
    • select libusb-win32 as driver to be installed


来源:https://stackoverflow.com/questions/5385281/pyusb-on-windows-7-cannot-find-any-devices

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!