How to Solve NameError: name 'WINDOWS' is not defined -- pip

Solution: Import the 'WINDOWS' module

# Add the following line to the top of your code
from pip._internal.utils.compat import WINDOWS

 

For more information:
pip WINDOWS