Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to install libusb-1.0 dll for libusb1 on win64 #7

Closed
RiceeeChang opened this issue May 8, 2015 · 5 comments
Closed

How to install libusb-1.0 dll for libusb1 on win64 #7

RiceeeChang opened this issue May 8, 2015 · 5 comments

Comments

@RiceeeChang
Copy link

I have some problem when I test this package on win64.

File "C:\Python27\lib\site-packages\libusb1.py", line 195, in
libusb = loadLibrary()
File "C:\Python27\lib\site-packages\libusb1.py", line 166, in loadLibrary
return dll_loader('libusb-1.0' + suffix, **loader_kw)
File "C:\Python27\lib\ctypes__init
.py", line 365, in init
self._handle = _dlopen(self._name, mode)
WindowsError: [Error 126] The specified module could not be found

then I download the binary for windows from http://libusb.info/
but I have no idea which file I should use and where I could put the dll file.
Could anyone help me, please

@vpelletier
Copy link
Owner

Hi.

First, I do not have a 64bits windows at hand, so I'm just guessing and cannot actually check.
In the archive you have likely downloaded (libusb-1.0.19-rc1-win.7z), you need to extract MS64\dll\libusb-1.0.dll or MS32\dll\libusb-1.0.dll. Choosing between MS64 and MS32 directories likely depends on the python build you are using, whether it was built for 64bits or 32bits.
Contained README advises to either install the DLL in system32 (no idea if that name is applicable on 64bits windows) or in the runtime directory. The latter may both mean it should be put in the same directory as your script, or in the same directory as the python interpreter. I guess you should first try to put it in the same directory as your script first, as it seems cleaner.

@RiceeeChang
Copy link
Author

Thank you for your response.
I have ever tried placing the dll file in the package directory in python (C://python27/lib/site-packages)
and placing the dll file in c://windows/sysWow64. Both of they are useless.

I just put the dll file at the same directory with my script, then it work.
Thank you again.

@vpelletier
Copy link
Owner

I have ever tried placing the dll file in the package directory in python (C://python27/lib/site-packages)

This would be the pace for python modules. Here it is not python but the dynamic library loader which needs to find the library - so I would have tried to put the library next to python.exe.

Then again, for distribution ease (if you intend to distribute the program you are working on) and for the sake of avoiding the risk of doing mistakes in system/other program folders, putting it next to your script is likely a better solution - so I'm glad it works there.

Closing bug as resolved, thanks.

@Sebatset11
Copy link

thanks! the same error drove me crazy for half weekend :)!!

@oznotes
Copy link

oznotes commented Sep 26, 2018

put the "libusb-1.0.dll" in your script folder worked for me too .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants