문제


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

도움이 되었습니까?

해결책

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.

다른 팁

Try:

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

It worked for me.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top