ojacques / SynthesiaKontrol

:musical_keyboard: Use Native Instruments Komplete Kontrol mk2 light guide in Synthesia
MIT License
110 stars 20 forks source link

module 'hid' has no attribute 'device' (macOS) #13

Closed joshstovall closed 3 years ago

joshstovall commented 4 years ago

I am trying to get this working on macOS, and get this message. Any suggestions for a solution?

python3 SynthesiaKontrol.py

Select your keyboard (1,2,3,...):
  1-Komplete Kontrol S61 MK2
  2-Komplete Kontrol S88 MK2
  3-Komplete Kontrol S49 MK2
  4-Komplete Kontrol S61 MK1
  5-Komplete Kontrol S88 MK1
  6-Komplete Kontrol S49 MK1
  7-Komplete Kontrol S25 MK1
3
Connecting to Komplete Kontrol Keyboard
Opening Keyboard device...
Traceback (most recent call last):
  File "SynthesiaKontrol.py", line 224, in <module>
    connected = init()
  File "SynthesiaKontrol.py", line 24, in init
    device=hid.device()
AttributeError: module 'hid' has no attribute 'device'
AlFalahTaieb commented 4 years ago

Did you try to run it as root ?

sudo python3 SynthesiaKontrol.py

ojacques commented 4 years ago

@joshstovall - per this video from someone who uses a MAC, this seems to work: image

Did you use the "pip install" commands per this?

jonlambert commented 4 years ago

FWIW I'm running into this issue too at the moment. I've installed pip dependancies, and hidapi (via Homebrew).

Running as root yields the same:

AttributeError: module 'hid' has no attribute 'device'

macOS Version: 10.14.6 Python Version: Python 3.7.7

jonlambert commented 4 years ago

I've tracked down the problem. I had another hid library installed, so running:

pip3 uninstall hid && pip3 install -r requirements.txt

This fixed the issue for me!