How to Solve NameError: name 'pkg_resources' is not defined

Solution: Import the 'pkg_resources' module

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

import pkg_resources

 

For more information:
Python pkg_resources