I am using google oauth2client, and the code from the example:
flags = argparser.parse_args()
credentials = run_flow(flow, storage, flags)
Everything works in Python interactive or IDE, but if I try to use the code from Jupiter Notebook, I got an exception.
Inside Jupiter Noteboo I try simply:
from oauth2client.tools import argparser
argparser.parse_args()
and got:
usage: __main__.py [
[
[
[
__main__.py: error: unrecognized arguments: -f /run/user/1000/jupyter/kernel-c9aa5199-fcea-4884-8e5f-a004c66a733e.json
SystemExit Traceback (most recent call last)
<ipython-input-3-d141fc7aebe0> in <module>()
/usr/lib/python3.5/argparse.py in parse_args(self, args, namespace)
1736 if argv:
1737 msg = _('unrecognized arguments: %s')
-> 1738 self.error(msg % ' '.join(argv))
1739 return args
1740
/usr/lib/python3.5/argparse.py in error(self, message)
2392 self.print_usage(_sys.stderr)
2393 args = {'prog': self.prog, 'message': message}
-> 2394 self.exit(2, _('%(prog)s: error: %(message)s\n') % args)
/usr/lib/python3.5/argparse.py in exit(self, status, message)
2379 if message:
2380 self._print_message(message, _sys.stderr)
-> 2381 _sys.exit(status)
2382
2383 def error(self, message):
SystemExit: 2
source
share