How to Solve NameError: name 'AF_INET' is not defined -- netifaces
Solution: Import the 'AF_INET' module
To Solve the error, add the following line to the top of your code.
from netifaces import AF_INET
For more information:
Python netifaces AF_INET