Search code examples
pythonjupyter-notebookjupytergmail-apigmail-imap

How do I get Gmail Api to actually import?


I am using the Gmail API to try to create a project. And I am using Jupyter Notebook which is an IDE that is run locally in your browser. And in order to use the API, you have to enter a URI in the credentials page in the https://console.developers.google.com/ Google account.

Only then you can use the API. But with Jupyter, the URI changes every time the code is run. I am super confused about what to do to solve this problem. Any advice?

https://console.developers.google.com/apis/credentials/oauthclient/173761931313-i8g5p0jknbcjncau2uv8du35cg5ti8a5.apps.googleusercontent.com?project=quickstart-1586630092877&pli=1

Here is the code Gmail provides for Python:

https://developers.google.com/gmail/api/quickstart/python


Solution

  • I think I experienced a similar issue. I solved it by, creating credentials, type: Desktop App. Then Jupyter Notebook can pass the authorization, and you can select a gmail account to authorize.