Python 没有名为usb.core的模块

Python 没有名为usb.core的模块,python,usb,pyusb,Python,Usb,Pyusb,如何在下面提到的程序中删除此错误?我得到的错误是 ImportError: No module named usb.core 我的代码是: import usb.core import usb.util # find our device dev = usb.core.find(idVendor=0xfffe, idProduct=0x0001) # was it found? if dev is None: raise ValueError('Device not found')

如何在下面提到的程序中删除此错误?我得到的错误是

ImportError: No module named usb.core
我的代码是:

import usb.core
import usb.util

# find our device
dev = usb.core.find(idVendor=0xfffe, idProduct=0x0001)

# was it found?
if dev is None:
    raise ValueError('Device not found')

# set the active configuration. With no arguments, the first
# configuration will be the active one
dev.set_configuration()

# get an endpoint instance
cfg = dev.get_active_configuration()
intf = cfg[(0,0)]

ep = usb.util.find_descriptor(
    intf,
    # match the first OUT endpoint
    custom_match = \
    lambda e: \
        usb.util.endpoint_direction(e.bEndpointAddress) == \
        usb.util.ENDPOINT_OUT)

assert ep is not None

# write the data
ep.write('test')
操作系统是windows 8 64位[…] ValueError:没有可用的后端

请允许我翻译:您忘记安装正确的USB驱动程序

USB设备需要一个驱动程序才能在Windows中工作。查看PyUSB了解详细信息,并使用它为您生成和安装驱动程序(例如LibUSB-Win32)。此程序负责Windows 8希望看到的驱动程序inf文件的证书

顺便说一句:您应该用于USB开发的视频是
0x4242

错误:

C:\Users\RAHUL\Desktop\python progrms\USBsample.py, line 5, in <module>
dev = usb.core.find(idVendor=0xfffe, idProduct=0x0001) File "C:\Python27\lib\site-
packages\usb\core.py", line 864, in find raise ValueError('No backend available')
ValueError: No backend available
C:\Users\RAHUL\Desktop\python progrms\USBsample.py,第5行,在
dev=usb.core.find(idVendor=0xfffe,idProduct=0x0001)文件“C:\Python27\lib\site-
packages\usb\core.py”,第864行,在find-raise-ValueError(“没有可用的后端”)中
ValueError:没有可用的后端

下载并安装它应该可以工作。

您在什么操作系统下运行?一般来说,您是否安装了PyUSB?请检查这个问题:操作系统是windows 8 64位的,是的,我已经安装了,但我现在遇到了错误:回溯(最近一次调用):文件“C:\Users\RAHUL\Desktop\python progrms\USBsample.py”,第5行,在dev=usb.core.find(idVendor=0xfffe,idProduct=0x0001)文件中“C:\Python27\lib\site packages\usb\core.py”,第864行,在find raise ValueError(“无后端可用”)ValueError:无后端可用