{"id":23851,"library":"hid","title":"hid","description":"A Python wrapper for hidapi using ctypes bindings. It provides low-level access to HID (Human Interface Device) devices on Linux, macOS, and Windows. Current version: 1.0.9. Release cadence: infrequent.","status":"active","version":"1.0.9","language":"python","source_language":"en","source_url":"https://github.com/apmorton/pyhidapi","tags":["hid","usb","ctypes","hidapi"],"install":[{"cmd":"pip install hid","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"System-level library; on Linux install via package manager (e.g., libhidapi-dev), on macOS via brew (hidapi), on Windows preinstalled or via vcpkg.","package":"hidapi","optional":false}],"imports":[{"note":"enumerate is a built-in; importing directly shadows it.","wrong":"from hid import enumerate","symbol":"enumerate","correct":"import hid; hid.enumerate()"},{"note":"Similar to enumerate, device is a class but best accessed via module.","wrong":"from hid import device","symbol":"device","correct":"import hid; d = hid.device()"}],"quickstart":{"code":"import hid\n\nfor device in hid.enumerate(0, 0):\n    print(f\"0x{device['vendor_id']:04x}:0x{device['product_id']:04x} {device['product_string']}\")","lang":"python","description":"Lists all HID devices on the system."},"warnings":[{"fix":"Use hid.enumerate(vendor_id=0, product_id=0) for all devices.","message":"hid.enumerate(0, 0) returns all devices; passing (vendor_id, product_id) filters. Many users call it incorrectly.","severity":"gotcha","affected_versions":"all"},{"fix":"Consider using cython-hidapi or hidapi package if issues arise.","message":"The library is not actively maintained; last release 2020. May lack support for newer hidapi features.","severity":"deprecated","affected_versions":"1.0.9"},{"fix":"Install hidapi via vcpkg or download prebuilt DLL and place in working directory.","message":"On Windows, hidapi DLL must be in PATH or alongside the script. Missing DLL causes ImportError.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run 'pip install hid' and ensure the Python environment is active.","cause":"hid module not installed or not in Python path.","error":"ImportError: No module named hid"},{"fix":"Install hidapi DLL (e.g., from http://libusb.info or vcpkg) and place in system PATH or script folder.","cause":"Windows missing hidapi DLL.","error":"OSError: [Error 126] The specified module could not be found"},{"fix":"Uninstall conflicting packages: 'pip uninstall hid' and reinstall 'pip install hid'.","cause":"The hid module is not imported correctly; possibly a naming conflict with another hid module.","error":"AttributeError: module 'hid' has no attribute 'enumerate'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}