codedance / Retaliation

A Jenkins "Extreme Feedback" Contraption - fire foam rockets at build breaking perpetrators.
598 stars 85 forks source link

USB core error import on mac #13

Open rabbadab opened 10 years ago

rabbadab commented 10 years ago

Hi, Maybe this is because i'm new to Python but I can't find a solution to this error I get when I try to run the script.

Traceback (most recent call last): File "retaliation.py", line 83, in import usb.core ImportError: No module named usb.core

I have installed the libusb with homebrew on my mac and I have also tried to install python again with homebrew to make new paths.

codedance commented 10 years ago

It's been a while since I've installed Retaliation on a Mac. The error suggests that python's USB support. Libusb is a requirement but you'll also need USB support in Python.

I found this post on Stack Overflow. It may help:

http://stackoverflow.com/questions/6213361/python-pyusb-import-usb-core-doesnt-work

Let me know if any of the suggestions work.

jtheoof commented 9 years ago

I had the same problem as you @rabbadab. All I had to do was to install python using homebrew and then in a new shell:

$ which python
/usr/local/bin/python

$ pip install pyusb
Collecting pyusb
  Downloading pyusb-1.0.0b2.tar.gz (57kB)
    100% |████████████████████████████████| 61kB 2.0MB/s
Installing collected packages: pyusb
  Running setup.py install for pyusb
Successfully installed pyusb-1.0.0b2
codedance commented 9 years ago

Thanks @jtheoof So you've had to install pyusb with pip? Do you think a change to the README would help? e.g.

On a mac system, run the following commands:

brew install libusb
pip install pyusb
jtheoof commented 9 years ago

Yes this is definitely the right steps. However I was not able to pass the kernel extension issues with Yosemite. See #20.

jtheoof commented 9 years ago

To more correct @codedance, the install process on os x would be:

brew install python # also installs pip
brew install libusb 
pip install pyusb