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

Solution: Import the 'RequestException' module

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

from requests.exceptions import RequestException

 

For more information:
Python requests RequestException