简体   繁体   中英

Why won't my ezgmail.init() function work?

I enter the following code in my interactive shell and I can't get it to execute properly. Can you help with this?

import os, ezgmail

os.chdir('/Users/trevorstathatos/Documents')

ezgmail.init()
/Users/trevorstathatos/Library/Application Support/mu/mu_venv-38-20211212-105811/lib/python3.8/site-packages/oauth2client/_helpers.py:255: UserWarning: Cannot access token.json: No such file or directory
  warnings.warn(_MISSING_FILE_MESSAGE.format(filename))
---------------------------------------------------------------------------
UnicodeDecodeError                        Traceback (most recent call last)
<ipython-input-3-0c385076e86e> in <module>
----> 1 ezgmail.init()

you should take a look at the documentation

To log in to your Gmail account, simple import EZGmail after setting up the credentials.json and token.json files:

import ezgmail

If you'd like to log in as a different user (based on different credentials.json and token.json files), call ezgmail.init() and pass the filenames for the credential and token files you generated.

ezgmail.init(tokenFile='token.json', credentialsFile='credentials.json')

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM