System: Kernel: 5.4.0-65-generic x86_64 bits: 64 compiler: gcc v: 9.3.0 Desktop: Cinnamon 4.6.7
wm: muffin dm: LightDM Distro: Linux Mint 20 Ulyana base: Ubuntu 20.04 focal
我觉得itertools已经安装了?如果是这样,imap是否已被删除
完整的错误消息
Exception has occurred: ImportError
cannot import name 'imap' from 'itertools' (unknown location)
File "/address/program.py", line 10, in <module>
from itertools import imap```
Python 3 version of ^{} 没有
imap()
函数,而是Python 2 version did在Python 3中,内置的
map()
函数具有相同的功能我猜您的代码是用Python2编写的,但您试图(意外地)用Python3运行它
选中
python version
,或者,如果您想绝对确定,请运行相关问题 更多 >
编程相关推荐