I installed MacPorts and with that installed libusb. Then I downloaded PyUSB and tried to excute the PyUSB sample code with Python's IDLE and Apple Xcode. However, I got the same result with both. It failed to find libusb (it's called beckend in PyUSB code which loooks for them). This is the sample code I used to run PyUSB:
import usb.core
import usb.utils
dev = usb.core.find(find_all=True)
print dev
And this is the error I got:
Traceback (most recent call last):
File "mynewpyproj.py", line 7, in <module>
dev = usb.core.find(find_all=True)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site- packages/usb/core.py", line 864, in find
raise ValueError('No backend available')
ValueError: No backend available
I tried to use this post and somehow link Xcode and libusb together, but I couldn't do it - I couldn't figure how to. I used Stack Overflow question How to set up libusb on Mac OS X? as a reference. I ran it on Linux Fedora and everything work great, but on Mac OS X it's much more difficult purpose to setup PyUSB in Mac OS X and with that to get information about USB devices like device class, speed, name, etc.
Also, I would like to get the port number from PyUSB. How do I get it with PyUSB? Is it possible?