2013-08-25 69 views
3

我一直在嘗試使用Python最近訪問Google Calendar API,因此我下載了示例程序,通過命令行運行它,並獲得在瀏覽器接受驗證後發生此錯誤:Google Calendar Python API示例:無法在accounts.google.com上找到服務器

Traceback (most recent call last): 
    File "sample.py", line 133, in <module> 
    main(sys.argv) 
    File "sample.py", line 102, in main 
    credentials = run(FLOW, storage) 
    File "C:\Python27\oauth2client\util.py", line 128, in positional_wrapper 
    return wrapped(*args, **kwargs) 
    File "C:\Python27\oauth2client\tools.py", line 197, in run 
    credential = flow.step2_exchange(code, http=http) 
    File "C:\Python27\oauth2client\util.py", line 128, in positional_wrapper 
    return wrapped(*args, **kwargs) 
    File "C:\Python27\oauth2client\client.py", line 1283, in step2_exchange 
    headers=headers) 
    File "C:\Python27\httplib2\__init__.py", line 1570, in request 
    (response, content) = self._request(conn, authority, uri, request_uri, met 
d, body, headers, redirections, cachekey) 
    File "C:\Python27\httplib2\__init__.py", line 1317, in _request 
    (response, content) = self._conn_request(conn, request_uri, method, body, 
aders) 
    File "C:\Python27\httplib2\__init__.py", line 1258, in _conn_request 
    raise ServerNotFoundError("Unable to find the server at %s" % conn.host) 
httplib2.ServerNotFoundError: Unable to find the server at accounts.google.com 

有沒有人知道爲什麼會發生這種情況?

+0

聽起來像是連接或DNS問題。 「ping accounts.google.com」產生了什麼? –

+0

我得到: Pinging accounts.l.google.com [2607:f8b0:4001:c05 :: 54]與32個字節的數據: PING:傳輸失敗。一般失敗。 PING:傳輸失敗。一般失敗。 PING:傳輸失敗。一般失敗。 PING:傳輸失敗。一般失敗。 平統計2607:f8b0:4001:C05 :: 54: 包:發送= 4,接收= 0,丟失= 4(100%的損失),' 所以我想有一個連接問題。 – aftrumpet

+0

您需要禁用6to4,Teredo和ISATAP。 –

回答

3

這聽起來像您的計算機認爲它具有到Internet的IPv6連接,並且正嘗試通過該連接連接到Google。不幸的是,它實際上並不工作。嘗試在計算機上禁用IPv6(WindowsMac,Linux),看看是否有幫助。

相關問題