decoding-contour-next-link icon indicating copy to clipboard operation
decoding-contour-next-link copied to clipboard

read_minimed_next24.py: No module named 'hid' error

Open jrussell88 opened this issue 6 years ago • 3 comments

I'm running Ubuntu 17.04; I installed hidapi, but read_minimed_next24 is failing with the error: ImportError: No module named 'hid'

/git$ python3 -m decoding-contour-next-link.read_minimed_next24 Traceback (most recent call last): File "/media/john/Home/john/git/decoding-contour-next-link/read_minimed_next24.py", line 8, in import hid # pip install hidapi - Platform independant ImportError: No module named 'hid' During handling of the above exception, another exception occurred: Traceback` (most recent call last): File "/usr/lib/python3.5/runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "/usr/lib/python3.5/runpy.py", line 85, in _run_code exec(code, run_globals) File "/media/john/Home/john/git/decoding-contour-next-link/read_minimed_next24.py", line 9, in except WindowsError: NameError: name 'WindowsError' is not defined

Can anyone suggest what might be causing this?

jrussell88 avatar Oct 29 '17 17:10 jrussell88

# pip3 install hidapi

mortlind avatar Oct 29 '17 17:10 mortlind

I reinstalled the dependencies for pip3;

$ sudo -H pip3 install cython $ sudo -H pip3 install hidapi $ sudo -H pip3 install requests astm PyCrypto crc16 python-dateutil $ sudo -H pip3 install python-lzo

Then:

/git$ pip3 install -r requirements.txt

As I was still getting file errors:

/git$ python3 -m decoding-contour-next-link.read_minimed_next24 Traceback (most recent call last): File "/usr/lib/python3.5/runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "/usr/lib/python3.5/runpy.py", line 85, in _run_code exec(code, run_globals) File "/media/john/Home/john/git/decoding-contour-next-link/read_minimed_next24.py", line 1331, in downloadPumpSession(pumpDownload) File "/media/john/Home/john/git/decoding-contour-next-link/read_minimed_next24.py", line 1225, in downloadPumpSession mt.openDevice() File "/media/john/Home/john/git/decoding-contour-next-link/read_minimed_next24.py", line 759, in openDevice self.device.open( self.USB_VID, self.USB_PID ) File "hid.pyx", line 66, in hid.device.open OSError: open failed

I ran the commands as root:

/git$ sudo python -m decoding-contour-next-link.read_minimed_next24 /git$ sudo python3 -m decoding-contour-next-link.read_minimed_next24

which worked.

jrussell88 avatar Oct 29 '17 18:10 jrussell88

@jrussell88 I am currently fighting this problem with opening the HID as ordinary user. I am fixing the permissions with UDev rules, which looks like they work. I am out of my depth here, since on some PCs I still get errors when opening the device, even though the permissions seems to be allowing me.

mortlind avatar Oct 29 '17 18:10 mortlind