How to Solve NameError: name 'json_format' is not defined -- google

Solution: Import the 'json_format' module

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

from google.protobuf import json_format

 

For more information:
Python google json_format