Windows 8.1上的Pyusb-无后端可用-如何安装libusb? [英] Pyusb on windows 8.1 - no backend available - how to install libusb?

查看:197
本文介绍了Windows 8.1上的Pyusb-无后端可用-如何安装libusb?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

正在使用pyinstaller 3.1,python 2.7.9和tkinter.

Working on pyinstaller 3.1, python 2.7.9, and tkinter.

尝试使用pyusb代替pyserial,但没有可用的后端.调查 Windows上的Pyusb-无后端可用 Python中的USB接口,依此类推,看来我需要安装libusb.但是,当我在python下运行"import usb"和"import usb.core"时,没有错误.我不知道如何在项目中安装它以及如何在项目中使用它,如何告诉我的项目libusb在哪里.

Try to use pyusb instead of pyserial, but no backend available. Looking into Pyusb on windows - no backend available, PyUSB ValueError: No backend available, USB interface in Python, and so on, it seems that I need to install libusb. But when I run "import usb" and "import usb.core" under python, no errors. I have no idea how to install it and how to use it in my project, how to tell my project where libusb is.

我做了什么:

(1)下载libusb-win32-bin v1.2.6.0(01/17/2012)

(1) download libusb-win32-bin v1.2.6.0 (01/17/2012)

(2)x86 \ libusb0_x​​86.dll重命名为libusb0.dll

(2) x86\libusb0_x86.dll renamed to libusb0.dll

(3)在64位上,将其放入Windows \ syswow64 \ libusb0.dll. 在32位上,安装到Windows \ system32 \ libusb0.dll.

(3) On 64 bit, put it to Windows\syswow64\libusb0.dll. On 32 bit, Installs to Windows\system32\libusb0.dll.

仍然无法正常工作...

Still not working...

顺便说一句,我想完成一个基于Python的独立Windows应用程序.我不希望其他人安装libusb来运行我的应用程序.该怎么办?

By the way, I would like to finish one standalone python-based windows app. I do not hope others to install libusb to run my app. What to do?

推荐答案

我从此处下载了最新的libusb Windows二进制文件: http://sourceforge. net/projects/libusb/files/libusb-1.0/libusb-1.0.20/libusb-1.0.20.7z/download 然后我根据以下信息复制了libusb1.dll:在64位Windows上, 必须将MS64 \ dll \ libusb-1.0.dll复制到C:\ Windows \ System32并 (用于运行使用libusb的32位应用程序) 必须将MS32 \ dll \ libusb-1.0.dll复制到C:\ Windows \ SysWOW64. 然后我将libusb1.lib从二进制文件复制到python目录中的lib dir,现在pyusb对我有用.希望能帮助到你.

I downloaded latest libusb windows binaries from here: http://sourceforge.net/projects/libusb/files/libusb-1.0/libusb-1.0.20/libusb-1.0.20.7z/download then I copied libusb1.dll according to this: when you are on 64-bit Windows, MS64\dll\libusb-1.0.dll must be copied into C:\Windows\System32 and (for running 32-bit applications that use libusb) MS32\dll\libusb-1.0.dll must be copied into C:\Windows\SysWOW64. and then I copied libusb1.lib from binaries to lib dir in python directory and now pyusb works for me. hope it helps.

这篇关于Windows 8.1上的Pyusb-无后端可用-如何安装libusb?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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