Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 816
BAE Avatar asked Dec 06 '22 19:12

BAE


1 Answers

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.

like image 65
user3365107 Avatar answered Jan 01 '23 00:01

user3365107