How to Solve NameError: name 'constants' is not defined -- googletrans

Solution: Import the 'constants' module

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

from googletrans import constants

 

For more information:
Python googletrans constants