adafruit_itertool.islice

For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
tdrew
 
Posts: 4
Joined: Mon Jul 06, 2015 11:35 pm

adafruit_itertool.islice

Post by tdrew »

Hi Guys, I am trying to run the fft_simpletest.py example and having issues with the 'adafruit_itertools.islice' module. It tells me there is no 'islice' module.

Code: Select all


# imports """this is line 43, only comments before this line"""
from adafruit_itertools import islice, count
from math import pi, sin, cos, sqrt, pow, log
import array

__version__ = "0.0.0-auto.0"
__repo__ = "https://github.com/tschucker/Teaandtechtime_CircuitPython_FFT.git"

...
>>> %Run -c $EDITOR_CONTENT
Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
  File "teaandtechtime_fft.py", line 44, in <module>
ImportError: no module named 'adafruit_itertools.islice'
I am running this on the CLUE using the latest Thonny IDE 3.3.13, I have updated the circuitpython version, and the libraries but the error still exists. I am sure it is something simple but I just can't see it. [Sure enough, it is not listed in the module help function.]

Code: Select all

>>> help("adafruit_itertools")
object adafruit_itertools is of type str
  encode -- <function>
  find -- <function>
  rfind -- <function>
  index -- <function>
  rindex -- <function>
  join -- <function>
  split -- <function>
  splitlines -- <function>
  rsplit -- <function>
  startswith -- <function>
  endswith -- <function>
  strip -- <function>
  lstrip -- <function>
  rstrip -- <function>
  format -- <function>
  replace -- <function>
  count -- <function>
  partition -- <function>
  rpartition -- <function>
  center -- <function>
  lower -- <function>
  upper -- <function>
  isspace -- <function>
  isalpha -- <function>
  isdigit -- <function>
  isupper -- <function>
  islower -- <function>
>>>
Perhaps it has it been relocated or replaced, I would appreciate any assistance

User avatar
dastels
 
Posts: 15608
Joined: Tue Oct 20, 2015 3:22 pm

Re: adafruit_itertool.islice

Post by dastels »

There seems to be something wrong with the adafruit_itertools build/package. I'll let people know. In the meantime grap the source from https://github.com/adafruit/Adafruit_Ci ... ertools.py and drop it into CIRCUITPY/lib. Getting rid of the CIRCUITPY/lib/adafruit_itertools directory is probably a good idea.

Dave

User avatar
tdrew
 
Posts: 4
Joined: Mon Jul 06, 2015 11:35 pm

Re: adafruit_itertool.islice

Post by tdrew »

Thanks heaps Dave, that got me going

User avatar
dastels
 
Posts: 15608
Joined: Tue Oct 20, 2015 3:22 pm

Re: adafruit_itertool.islice

Post by dastels »

Cool. Enjoy it :)

And thanks for the heads up; a fix to what's in the bundle is in progress.

Dave

User avatar
adafruit_support_carter
 
Posts: 29056
Joined: Tue Nov 29, 2016 2:45 pm

Re: adafruit_itertool.islice

Post by adafruit_support_carter »

Where did that fft_simpletest.py example come from? It looks like it's not doing the import correctly:

Code: Select all

from adafruit_itertools import islice, count
That's just importing the folder, not the actual module. See correct syntax in example:
https://github.com/adafruit/Adafruit_Ci ... py#L30-L31

Should be something like:

Code: Select all

from adafruit_itertools.adafruit_itertools import islice, count
Also see comments here:
https://github.com/adafruit/Adafruit_Ci ... /issues/15

Locked
Please be positive and constructive with your questions and comments.

Return to “CLUE Board”