janja-janja / gmail-api-wrapper

Gmail API Wrapper - A Python Client
https://pypi.python.org/pypi/gmail-api-wrapper/
Other
26 stars 2 forks source link

I tried the gmail API authority success, but gmail_api.check_new_mail() failed #11

Open ocean001 opened 6 years ago

ocean001 commented 6 years ago

I did the second test on the read, error: C:\Anaconda3\python.exe C:/Users/liumin/PycharmProjects/StockA/GmailWrapperRead.py C:\Anaconda3\lib\site-packages\oauth2client_helpers.py:255: UserWarning: Cannot access C:\Users\name.credentials\gmail-api-wrapper-py.json: No such file or directory warnings.warn(_MISSING_FILE_MESSAGE.format(filename))

It did open a browser, but still gave me an final error after the above error: ==noauth_local_webserver (it popped up an login page, I login, webpage showed authorization success)

janja-janja commented 6 years ago

Hi @ocean001, there's a json file that should be available to you (from Gmail) that contains the auth details. You need to control the location of that file via export GAW_CLIENT_SECRET_FILE_PATH=<path-to-client-secret-json-file>. Set the variable GAW_CLIENT_SECRET_FILE_PATH to the location of that secret json file. If you're unable to set the variable, just rename the client.json file to gmail-api-wrapper-py.json

ocean001 commented 6 years ago

Thanks for quick reply. I set up the GAW_CLIENT_SECRET_FILE_PATH, I will try the rename the client.json to see what will happen. It is good to have your wrapper. Thanks.

janja-janja commented 6 years ago

Thank you. Let me know when you get stuck.

ocean001 commented 6 years ago

Thanks, @yoda-yoda , I did not get the expected results. Looks like the script run, and no results returned. I used under: Window 2012 server, and Anaconda, Python 3.6. Probably there is some problems with my environments. Thanks for your help.

ghost commented 5 years ago

If you are having any errors I recommend trying it in python 2.7.15, one I tried it in, then make sure you follow the exporting of variables by creating a virtual env and then activating it and then exporting those. It will definitely make your life a lot easier. I also had a credentials path of .credentials/gmail-api-wrapper-py.json and it worked like a charm.