0

I got Pyusb with pip install pyusb but when I try to import usb.core I get:

Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    import usb.core
  File "C:\Users\Owner\Desktop\usb.py", line 1, in <module>
    import pyusb
  ImportError: No module named 'pyusb'

I also tried installing pyusb-1.0.2.tar.gz manuall with pip, but that didn't fix the issue.

CMLSC
  • 113
  • 1
  • 3
  • 13
  • Did you install for python 2.7, and are trying to run it using python 3? Perhaps try `pip3 install pyusb`? – user3483203 Dec 25 '17 at 18:12
  • `where pip` and `where python` from *cmd* to make sure you are using the same tools. – CristiFati Dec 25 '17 at 18:13
  • @cristifati I actually ran pip directly with C:/Python34/Scripts/pip.exe install pyusb – CMLSC Dec 25 '17 at 18:19
  • @chris I'm using Python 3 and running pip from the Python34/Scripts folder. I haven't had problems installing libraries before. – CMLSC Dec 25 '17 at 18:22
  • 1
    Something doesn't seem right. You have an *usb.py* on you _Desktop_, which seems to conflict with a file having the same name from _pyusb_. Or did you install *pyusb* on Desktop? There are too few details. Btw, was the pip command successful? If it's your file on _Desktop_, try renaming it. – CristiFati Dec 25 '17 at 18:30
  • @CristiFati Okay, I think that was the issue. Should I delete this question since the question isn't accurate? – CMLSC Dec 25 '17 at 18:35
  • 1
    No, you should probably edit it. But the question is almost accurate, it provides details for identifying a list of problems leading to the behavior. Second thing you could do (now that you know the problem) is searching for similar questions (as there should be many of them) and mark it as a duplicate. Or you could answer your own question. – CristiFati Dec 25 '17 at 18:38

1 Answers1

0

I think you want import usb instead of import pyusb.

Chris Sears
  • 6,502
  • 5
  • 32
  • 35