Question


I'm trying to setup some python scripts for controlling low-level USB functions. In order to do this, I've found that two libraries need to be installed: libusb and pyusb. I first installed libusb and was successful, but now I'm having problems with pyusb (version 1.0.0).

I tried to install pyusb using the recommended command (in the pyusb folder): python setup.py install
From the output after running this command, it looks like it has installed with no problems. But when I try to run my simple program it gives an error:

  File "/Users/michael/Desktop/usb.py", line 1, in 
    import usb.core
ImportError: No module named core

My python script tries to import usb.core, so if there's no module, then pyusb didn't install.

Other people have had the same problem. Their approach was to uninstall the old versions of pyusb, but to my knowledge, I have no previous installations.

How would it be possible to install the pyusb library?

Thanks in advance. I really appreciate your help.
--m

Was it helpful?

Solution

You script, which you have decided to call usb.py, is being imported in place of the usb package provided by pyusb. Rename your script.

OTHER TIPS

Try:

sudo apt-get install python-pip
sudo pip install --upgrade pyusb

It worked for me.

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