How to Solve NameError: name 'print_function' is not defined -- __future__

Solution: Import the 'print_function' module

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

from __future__ import print_function

 

For more information:
Python __future__ print_function