T
T
tailgrab2020-04-10 16:58:55
Python
tailgrab, 2020-04-10 16:58:55

Why does hid.HIDException: unable to open device occur?

I am using python 3.8.
Everything works like this

>>> import hid
>>> hidraw = hid.Device(0x2341, 0x8036)
>>> hidraw.close()

However, one has only to distort usb and call hidraw = hid.Device(0x2341, 0x8036) again, then an error appears:
>>> hidraw = hid.Device(0x2341, 0x8036)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/hid/__init__.py", line 130, in __init__
    raise HIDException('unable to open device')
hid.HIDException: unable to open device

It is worth restarting python and everything connects normally again

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question