The buildstock_local is a command line interface to the program. It shouldn't be run from within a python terminal. It should be run from either bash (Mac and Linux) or cmd.exe, anaconda shell, or power shell (Windows).
buildstock_local