Windows 7上的Pyusb找不到任何设备 [英] Pyusb on Windows 7 cannot find any devices

查看:650
本文介绍了Windows 7上的Pyusb找不到任何设备的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我安装了Pyusb 1.0.0-alpha-1
在Windows下,我无法获得USB设备的任何句柄.

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

我确实插入了1个USB设备(idVendor = 0x04d8,idProduct = 0x0042),我尝试了usb.core.find(idVendor=0x04d8, idProduct=0x0042),但是也失败了.

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.

在Ubuntu下,使用pyusb和python(2.6)的相同版本,我能够使用该代码成功找到我的设备,并与之通信.

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.

那我怎样才能让pyusb在Windows 7上找到USB设备?

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

推荐答案

Libusb要求您为要使用它的每个设备安装一个特殊的驱动程序.这通常需要您编写一个包含设备USB ID的.inf文件.只有安装了驱动程序和inf文件,libusb才能看到"您的设备.

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.

这篇关于Windows 7上的Pyusb找不到任何设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆