Question

So, I've installed libusb and pyUSB on my OS X Lion (10.7.3) machine, and I have the following script running:

import usb
import time

if __name__ == "__main__":
    while True:
        busses = usb.busses()
        print busses[0]
        print busses[0].__dict__
        time.sleep(2)

I have a single USB device plugged in: a SanDisk cruzer micro, 4GB. I can open this flash drive in Finder and Disk Utility without issue. However, the output of the above script is:

<usb.legacy.Bus object at 0x108defe10>
{'dirname': '', 'devices': [], 'localtion': 0}
<usb.legacy.Bus object at 0x108ef4610>
{'dirname': '', 'devices': [], 'localtion': 0}
<usb.legacy.Bus object at 0x108defe10>
{'dirname': '', 'devices': [], 'localtion': 0}
<usb.legacy.Bus object at 0x108ef4610>
{'dirname': '', 'devices': [], 'localtion': 0}

Indicating, at least, that pyUSB's first and only bus doesn't believe that there are any devices attached presently. Is there some sort of fundamental setup that I've missed? Why can't pyUSB find my device?

I've been referencing this StackOverflow question to get started: usb device identification

Was it helpful?

Solution

Turns out it was a bad libusb install.

Get a fresh version from http://www.libusb.org.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top