How to Solve NameError: name 'permutations' is not defined -- itertools

Solution: Import the 'permutations' module

To Solve the error, add the following line to the top of your code.

from itertools import permutations

 

For more information:
Python itertools permutations