It looks like the oauth2client changed to use argparse instead of gflags (i.e changed the mechanism for registering flags). Try changing the code that currently says
credentials = run(flow, STORAGE)
to
import argparse
from oauth2client import tools
argparser = argparse.ArgumentParser(
description=__doc__,
formatter_class=argparse.RawDescriptionHelpFormatter,
parents=[tools.argparser])
flags = argparser.parse_args(sys.argv[1:])
credentials = tools.run_flow(flow, storage, flags)
Then, you shold be able to run
python bqexample.py --noauth_local_webserver
and it will give you a URL to cut and paste rather than trying to start up a webserver to automate the process.