You can't set it to only authenticate once and stay that way for a new runtime, because Colab runs on a VM that is recycled periodically. You can make sure force_remount
is set to False
so it doesn't unnecessarily ask you to reauthorize:
drive.mount('/content/gdrive', force_remount=False)
But any time you reset the runtime, you will need to reauthenticate with a different authorization code.