I had the exact same problem today.
Found the issue to be that the error is raising where you have .execute currently.
Try this library
from googleapiclient import errors
Try putting execute into a while or if statement
response = service.users().get(userKey=email)
if response is not None:
try:
r = response.execute()
user_email = r.get('primaryEmail', [])
print(user_email)
except errors.HttpError:
print('Not found')
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…