How to Solve NameError: name 'OrderedDict' is not defined -- collections

Solution: Import the 'OrderedDict' module

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

from collections import OrderedDict

 

For more information:
Python collections OrderedDict