Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation of hidapi on Raspberry Pi #5

Closed
GiantMolecularCloud opened this issue Jul 14, 2018 · 2 comments
Closed

Compilation of hidapi on Raspberry Pi #5

GiantMolecularCloud opened this issue Jul 14, 2018 · 2 comments

Comments

@GiantMolecularCloud
Copy link

Note that hidapi is a cython package and cython is not installed by default on Raspbian Stretch Lite.
I'd suggest adding a note to README.md:

Note that hidapi requires cython (sudo apt-get install cython) to be installed, otherwise pip install hidapi will result in an error code 1 in gcc.

Such a short note would have saved me at least an hour of wondering why it worked on a macbook but not a Raspberry Pi 3 B+ and might help others as well.

@vfilimonov
Copy link
Owner

@GiantMolecularCloud , thank you for the reporting! I'll add a note to readme that this problem might occur.

It is quite weird though - hidapi's setup.py has cython as a pre-requisite: https://github.com/trezor/cython-hidapi/blob/master/setup.py, so it should be installed by pip automatically...

@GiantMolecularCloud
Copy link
Author

I've tested this a bit further by re-installing Raspbian and co2meter. Likely, the problem wasn't cython but libudev-dev. While testing both of them were installed as dependencies and co2meter worked afterwards but I only noticed cython to get installed.

Anyway, if other people have similar problems: the following installation routine works on a fresh Raspbian Stretch Lite

sudo apt-get upgrade
sudo apt-get install python-dev cython libudev-dev libusb-1.0-0 libusb-dev libusb-1.0-0-dev libhidapi-dev libavahi-compat-libdnssd-dev
sudo pip install cython hidapi co2meter flask pandas HAP-python

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants