I want to query the Google Analytics API using Python to periodically download data from my Analytics account and store data in a local database. I am basically following the steps as given in the basic tutorial. I am using the Google client API library for Python in this process.

My script is working fine so far when I am running it on my local dev machine (Mac). When I start the script, my browser opens and I am prompted to grant access to my Analytics data from the app. Afterwards I can run my script as often as I want and get access to my data.

On my server (Ubuntu, only terminal available), the w3m browser opens, but I cannot access my Google account from there. I can only quit w3m and kill the program with Ctrl-C. There is an error message like:

Your browser has been opened to visit:

https://accounts.google.com/o/oauth2/auth?scope=some_long_url&access_type=offline

If your browser is on a different machine then exit and re-run this application with the command-line parameter

--noauth_local_webserver

However when I run my script with the parameter --noauth_local_webserver, I get the same results - w3m opens and I cannot authenticate.

How can I get the --noauth_local_webserver to work? I there another way to authenticate without a local browser on the same machine?

Edit
Report