Skip to main content

pyhidapi Installation

To install pyhidapi, use the standard module install procedure: python setup.py install. You also need to ensure that you have the required hidapi shared library. On Linux distributions, this is generally in the repositories (for instance, under Debian you can install either libhidapi-hidraw0 or libhidapi-libusb0 depending on which backend you want to use).

TODO I don't know the installation procedure for Windows or other Linux distributions. If there is anything special needed, please add docs for it here.

OSX Support

pyhidapi works on OSX, but requires that you first build a shared library. There may be better ways to do this, but what I did was as follows:

  1. Download the latest hidapi release from https://github.com/signal11/hidapi/downloads and unzip
  2. Navigate to the mac directory
  3. Modify the Makefile to include -fPIC on the CFLAGS line. My CFLAGS now look like this: CFLAGS+=-I../hidapi -Wall -g -c -fPIC
  4. Run make. You should now have a hid.o file in this directory.
  5. Create the shared library by running: gcc -shared -o libhidapi-iohidmanager.so hid.o -framework IOKit -framework CoreFoundation
  6. Copy the resulting libhidapi-iohidmanager.so to /usr/local/lib (or somewhere in the libs search path)
  7. Install pyhidapi as normal: python setup.py install
  8. Verify by running python interactively and typing the following lines:
import hid
hid.enumerate()

You should see a list of all USB hid devices on your system.

That's it!

Release files for hid 1.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hid 1.0.3
File Size Uploaded
hid-1.0.3.tar.gz 3.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for hid 1.0.3
File Interpreter ABI Platform
hid-1.0.3-py2-none-any.whl Python 2 none any Details

Total release size: 7.4 kB

Release files / hid-1.0.3.tar.gz

Download URL hid-1.0.3.tar.gz
Size 3.7 kB
Tags Source
SHA-256 checksum
How to use checksums
743fdc047d700e3012a99b741799f65bd1fabbd921c5f1e5363367f510d25670
BLAKE2b-256 checksum
How to use checksums
d688533994a2c7f2b61906beac1b291334b271e510b5c0877e027deba7cc58dd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.2.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/2.7.15

Release files / hid-1.0.3-py2-none-any.whl

Download URL hid-1.0.3-py2-none-any.whl
Size 3.7 kB
Tags Python 2
SHA-256 checksum
How to use checksums
0a09ea097a75743d908c91de7e792442d73e48e3b75a51b487cd536bb336d1a8
BLAKE2b-256 checksum
How to use checksums
ff06157153a3ecb1b24023226acbf137fdd51588dfe287b76fa4108c7d713317
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.2.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/2.7.15

Release history Release notifications | RSS feed

1.0.9

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

This release

1.0.3 This release

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.1.1

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page