logston / olimex-ekg-emg

A Python package for gathering data from the Olimex EKG/EMG Shield.
Other
17 stars 7 forks source link

TypeError: PacketStreamReader object is not an iterator #1

Closed logston closed 9 years ago

logston commented 9 years ago

hello,

I am trying to use olimex-ekg-emg 0.1.2, but I get this error. Do you have a solution?

Best regards

A

me@Me:~$ python
Python 2.7.6 (default, Mar 22 2014, 22:59:56) 
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from olimex.gui import show_exg
>>> show_exg('/dev/ttyACM0')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/olimex/gui.py", line 99, in show_exg
    animation.FuncAnimation(fig, lambda _: next(axes_refresher), interval=50)
  File "/usr/local/lib/python2.7/dist-packages/matplotlib/animation.py", line 1067, in __init__
    TimedAnimation.__init__(self, fig, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/matplotlib/animation.py", line 913, in __init__
    *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/matplotlib/animation.py", line 591, in __init__
    self._init_draw()
  File "/usr/local/lib/python2.7/dist-packages/matplotlib/animation.py", line 1092, in _init_draw
    self._draw_frame(next(self.new_frame_seq()))
  File "/usr/local/lib/python2.7/dist-packages/matplotlib/animation.py", line 1106, in _draw_frame
    self._drawn_artists = self._func(framedata, *self._args)
  File "/usr/local/lib/python2.7/dist-packages/olimex/gui.py", line 99, in <lambda>
    animation.FuncAnimation(fig, lambda _: next(axes_refresher), interval=50)
  File "/usr/local/lib/python2.7/dist-packages/olimex/gui.py", line 46, in axes_refresher_generator
    channel_values = next(reader)
TypeError: PacketStreamReader object is not an iterator
logston commented 9 years ago

Hi A,

Sorry to disappoint but this package is only compatible with Python 3.4+. Looks like you are running Python 2.7.6.

I am able to reproduce your error when I try to use this package in a Python 2.7.6 environment. I get no errors when I use this package in a Python 3.4+ environment.

Hope this helps.