importError: cannot import name 'izip_longest'

版权声明:如需转载本文章,请保留出处! https://blog.csdn.net/xc_zhou/article/details/86743302

importError: cannot import name ‘izip_longest’

解决方法:

itertools.izip在pyhton3中已被去掉了,zip成为内置的方法
返回的是迭代器 iterator, 而在python2 中返回的是 列表list。

找到使用了 from itertools import izip_longest 的文件, 将 izip_longest 改为 zip_longest。

然后重新按照之前的第二种安装方法,即下载包源文件,python3 setup.py install , 即可正常安装和使用。

猜你喜欢

转载自blog.csdn.net/xc_zhou/article/details/86743302
今日推荐