[Python] ModuleNotFoundError: No module named 'hidapi'

Discussão em 'Python' iniciado por Stack, Julho 16, 2025.

  1. Stack

    Stack Membro Participativo

    I want to run the following code:

    import hidapi

    # Find the device
    devices = hidapi.DeviceManager().devices()
    for device in devices:
    if device.vendor_id == 0x2341 and device.product_id == 0x0042:
    gamepad = device
    break

    # Read data from the device
    data = gamepad.read(64)
    print(data)


    I have installed hidapi using pip but it still says it can not find the module

    PS C:\Users\felix\OneDrive\Desktop\UE5 Space Ship Project> pip3 install hidapi
    Defaulting to user installation because normal site-packages is not writeable
    Collecting hidapi
    Using cached hidapi-0.14.0.post4-cp312-cp312-win_amd64.whl.metadata (3.7 kB)
    Requirement already satisfied: setuptools>=19.0 in c:\python312\lib\site-packages (from hidapi) (75.6.0)
    Using cached hidapi-0.14.0.post4-cp312-cp312-win_amd64.whl (70 kB)
    Installing collected packages: hidapi
    Successfully installed hidapi-0.14.0.post4
    PS C:\Users\felix\OneDrive\Desktop\UE5 Space Ship Project> python -u "c:\Users\felix\OneDrive\Desktop\UE5 Space Ship Project\HID_test.py"
    Traceback (most recent call last):
    File "c:\Users\felix\OneDrive\Desktop\UE5 Space Ship Project\HID_test.py", line 1, in <module>
    import hidapi
    ModuleNotFoundError: No module named 'hidapi'
    PS C:\Users\felix\OneDrive\Desktop\UE5 Space Ship Project>


    I'm running Python 3.12.6 on Windows 11.

    Continue reading...

Compartilhe esta Página