Have you considered adding `sys.argv.append('-b-')` before importing ROOT? Runs PyRoot in batch mode.