izip_longest was renamed to zip_longest in Python 3 (note no i at the beginning), import instead:
from itertools import zip_longest
and use that name in your code.
If you need to write code that works in both Python 2 and 3, catch ImportError to try a different name and then rename:
try: # Python 3 from itertools import zip_longest except ImportError: # Python 2 from itertools import izip_longest as zip_longest # use the name zip_longest
source share