Discussion:
[pyusb-users] Beginner's question
Bomin Nie
2015-08-11 08:46:49 UTC
Permalink
Hi,

I'm not sure if this is the correct place that I shoot my question, if it's
not, please redirect me to the right place or somewhere I can find the
answsers

So, I'm on a project to use python to access my usb devices and I'm on
Window 7. I downloaded the zip version from https://walac.github.io/pyusb/,
after which I ran "python setup.py install", and then I tried to "import
usb.core", but I failed, Well, I can see this directory
"c:\Python27\Lib\site-packages\usb\", and it has core.py in it. What I'm
doing now is copying the "usb" directory to my project working directory,
and "import usb.core" works.... How should I fix this?

Since I got the "import usb.core" working, I then try to find devices.
And, I got "NoBackendError". I then
- downloaded the windows binary from "http://libusb.info/"
- copy "MS64\dll\libusb-1.0.dll" to my
"c:\Windows\SysWOW64\libusb-1.0.dll". My win7 is 64 bit.

It still gives me the same error... What am I supposed to do more?
--
Nie Bomin
Bomin Nie
2015-08-11 08:52:14 UTC
Permalink
Sorry, ignore my first question about "import usb.core" does not work. I
named my py file as usb.py, and after I renamed it, it's working now.
Post by Bomin Nie
Hi,
I'm not sure if this is the correct place that I shoot my question, if
it's not, please redirect me to the right place or somewhere I can find the
answsers
So, I'm on a project to use python to access my usb devices and I'm on
Window 7. I downloaded the zip version from
https://walac.github.io/pyusb/, after which I ran "python setup.py
install", and then I tried to "import usb.core", but I failed, Well, I can
see this directory "c:\Python27\Lib\site-packages\usb\", and it has core.py
in it. What I'm doing now is copying the "usb" directory to my project
working directory, and "import usb.core" works.... How should I fix this?
Since I got the "import usb.core" working, I then try to find devices.
And, I got "NoBackendError". I then
- downloaded the windows binary from "http://libusb.info/"
- copy "MS64\dll\libusb-1.0.dll" to my
"c:\Windows\SysWOW64\libusb-1.0.dll". My win7 is 64 bit.
It still gives me the same error... What am I supposed to do more?
--
Nie Bomin
--
Nie Bomin
Tormod Volden
2015-08-26 09:37:15 UTC
Permalink
Post by Bomin Nie
Sorry, ignore my first question about "import usb.core" does not work. I
named my py file as usb.py, and after I renamed it, it's working now.
Post by Bomin Nie
Since I got the "import usb.core" working, I then try to find devices.
And, I got "NoBackendError". I then
- downloaded the windows binary from "http://libusb.info/"
- copy "MS64\dll\libusb-1.0.dll" to my
"c:\Windows\SysWOW64\libusb-1.0.dll". My win7 is 64 bit.
This can seem confusing, however 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

Which one will be used depends on whether the python that runs is 32
or 64 bit. If you just run python in a command window it will list on
the first line if it is 32 bit, example:
C:\>python
Python 2.7.5 (default, May 15 2013, 22:43:36) [MSC v.1500 32 bit
(Intel)] on win32

Note that the above example was run on 64-bit Windows 7, it is just
that the 32-bit python sees a 32-bit emulator environment and
therefore reports "on win32".
Post by Bomin Nie
Post by Bomin Nie
It still gives me the same error... What am I supposed to do more?
If the above is not enough, you might find some useful information here:
https://github.com/libusb/libusb/wiki/Windows#How_to_use_libusb_on_Windows

Regards,
Tormod

------------------------------------------------------------------------------
Loading...