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

Larry Martell larry.martell at gmail.com
Thu Aug 8 13:50:45 EDT 2019


On Thu, Aug 8, 2019 at 1:33 PM Peter Otten <__peter__ at web.de> wrote:
>
> Larry Martell wrote:
>
> >> 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.
> >
> > I grepped through the entire pyke code and imap is not in there.
>
> Fire up the python3 interpreter that you use to run your script:
>
> >>> import pyke
> >>> pyke.__file__
> '/somewhere/pyke/__init__.py'
>
> Then grep starting in the directory shown above and be enlightened ;)
>
> If I'm wrong here's an alternative guess (I know nothing about pyke):
>
> knowledge_engine.engine((rule_base_source_folder,
> (compiled_rule_base_folder)))
>
> Are the rules "compiled" into Python? Then Make sure that you use separate
> `compiled_rule_base_folder`s for Python 2 and 3.

I figured it out - pyke creates python code and the code created by
the py2 version of pyke was still there and being used. Once I deleted
those the p3y pyke recreated them and it worked. Thanks!



More information about the Python-list mailing list