How to Solve NameError: name 'get_config_var' is not defined -- sysconfig
Solution: Import the 'get_config_var' module
# Add the following line to the top of your code
from sysconfig import get_config_var
For more information:
sysconfig get_config_var