Pyusb on windows 8.1 - no backend available - how to install libusb?

℡╲_俬逩灬. 提交于 2019-12-05 03:49:39

问题


Working on pyinstaller 3.1, python 2.7.9, and tkinter.

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.

what I did:

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

(2) x86\libusb0_x86.dll renamed to 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...

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?


回答1:


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.



来源:https://stackoverflow.com/questions/33972145/pyusb-on-windows-8-1-no-backend-available-how-to-install-libusb

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