1

I'm trying to execute this example here: Step 3 @ Gmail API Python Quickstart I got two errors and got aroudn them

  1. Unable to unintsall a exisiting version of six - got around by setting it to

    --ignore-installed six

  2. Unable to find httplib2 - got around by doing a specific

    pip2 install httplib2

Now when I go the working directory where my client_secret.json & quickstart.py are located and execute a python quickstart.py I get the follwoing error. Any ideas how to get this code to execute.

bash-3.2$ python quickstart.py 
/Library/Python/2.7/site-packages/oauth2client/_helpers.py:255: UserWarning: Cannot access /Users/Zafar/.credentials/gmail-python-quickstart.json: No such file or directory
  warnings.warn(_MISSING_FILE_MESSAGE.format(filename))
Traceback (most recent call last):
  File "quickstart.py", line 73, in <module>
    main()
  File "quickstart.py", line 57, in main
    credentials = get_credentials()
  File "quickstart.py", line 45, in get_credentials
    credentials = tools.run_flow(flow, store, flags)
  File "/Library/Python/2.7/site-packages/oauth2client/_helpers.py", line 133, in positional_wrapper
    return wrapped(*args, **kwargs)
  File "/Library/Python/2.7/site-packages/oauth2client/tools.py", line 218, in run_flow
    authorize_url = flow.step1_get_authorize_url()
  File "/Library/Python/2.7/site-packages/oauth2client/_helpers.py", line 133, in positional_wrapper
    return wrapped(*args, **kwargs)
  File "/Library/Python/2.7/site-packages/oauth2client/client.py", line 1934, in step1_get_authorize_url
    return _helpers.update_query_params(self.auth_uri, query_params)
  File "/Library/Python/2.7/site-packages/oauth2client/_helpers.py", line 222, in update_query_params
    parts = urllib.parse.urlparse(uri)
AttributeError: 'Module_six_moves_urllib_parse' object has no attribute 'urlparse'
1
  • first uninstall six python3 - pip3 uninstall six, python2 - pip uninstall six and then reinstall Commented Dec 1, 2016 at 3:52

1 Answer 1

1

I've just faced the same problem. You need to create the file and name it gmail-python-quickstart.json.

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you. Good to know.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.