AttributeError: module 'itertools' has no attribute 'imap'

Larry Martell larry.martell at gmail.com
Thu Aug 8 12:45:34 EDT 2019


On Thu, Aug 8, 2019 at 12:34 PM Rhodri James <rhodri at kynesim.co.uk> wrote:
>
> On 08/08/2019 17:16, Larry Martell wrote:
> > On Thu, Aug 8, 2019 at 11:30 AM Peter Otten <__peter__ at web.de> wrote:
> >>
> >> Larry Martell wrote:
> [snip]
> >>> But in py3 that fails with: AttributeError: module 'itertools' has no
> >>> attribute 'imap'
> >>
> >> In Python 3 the map() builtin is "lazy", so you can use that instead.
> >>
> >>> I tried converting presentationGen to a list but get the same error.
> >>>
> >>> How can I make this work in py3?
> >>
> >> The problem is in the project rather than in your code -- you have to port
> >> pyke to Python 3 before you can use it.
> [snip]
> >
> > Pyke has been ported to py3. Here is the code that returns the data I
> > am trying to process:
> >
> > return map(self.doctor_answer, it)
> >
> > I don't see anything calling imap.
>
> That suggests you aren't calling the code you think you're calling.  I
> think a little poking with pdb or some strategic prints is in order...

I traced through the code with pdb. It is running from
/usr/local/lib/python3.5/dist-packages/pyke and I grepped that for
imap. Nothing



More information about the Python-list mailing list