2016-11-29 39 views
1

我想在這裏執行此示例:@Gmail API Python Quickstart 第3步我有兩個錯誤,並得到了他們aroudnGmail的API的Python快速入門的Gmail,蟒蛇,quickstart.json:沒有這樣的文件或目錄

  1. 無法unintsall六一exisiting版本 - 得到周圍通過將其設定

    --ignore-installed six

  2. 無法找到httplib2的 - 做一個特定

    傳開

    pip2 install httplib2

現在,當我去工作目錄在我的client_secret.json & quickstart.py位於和執行python quickstart.py我得到的follwoing錯誤。任何想法如何讓這個代碼執行。

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' 
+0

第一次卸載'six' python3 - pip3卸載六,python2 - pip卸載六,然後重新安裝 –

回答

1

我剛剛面臨同樣的問題。 您需要創建該文件並將其命名爲gmail-python-quickstart.json。

+0

謝謝。很高興知道。 – ZeExplorer

相關問題