How to Solve NameError: name 'HTTPBasicAuth' is not defined -- requests

Solution: Import the 'HTTPBasicAuth' module

# Add the following line to the top of your code
from requests.auth import HTTPBasicAuth

 

For more information:
requests HTTPBasicAuth