Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

read_minimed_next24.py: No module named 'hid' error #27

Open
jrussell88 opened this issue Oct 29, 2017 · 3 comments
Open

read_minimed_next24.py: No module named 'hid' error #27

jrussell88 opened this issue Oct 29, 2017 · 3 comments

Comments

@jrussell88
Copy link

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?

@mortlind
Copy link

mortlind commented Oct 29, 2017

# pip3 install hidapi

@jrussell88
Copy link
Author

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.

@mortlind
Copy link

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants