[問題] Facebook sdk for Python的__init__

看板Python作者 (暴風雪之喀秋莎)時間7年前 (2018/04/13 12:03), 編輯推噓1(101)
留言2則, 1人參與, 7年前最新討論串1/1
graph = facebook.GraphAPI(access_token = (my token), version = '2.12') 這行一直出現: GraphAPIError("Version number should be in the" facebook.GraphAPIError: Version number should be in the following format: #.# (e.g. 2.0). 可能是格式不對導致系統判定版本時出錯 因為我把2.12改成2.7就不會有錯了 我查到的__init__是有五個參數的,如果self不算的話 可是官方文件上面 http://facebook-sdk.readthedocs.io/en/latest/api.html 雖然有提到__init__有五個參數, access_token, timeout, version, proxies, session 但網頁上的example卻長這樣 graph = facebook.GraphAPI(access_token="your_token", version="2.12") 而且前面timeout, proxies我都沒有寫,也沒有報錯 請問有人遇到一樣的問題嗎? -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 223.136.175.220 ※ 文章網址: https://www.ptt.cc/bbs/Python/M.1523592189.A.B02.html

04/13 15:24, 7年前 , 1F
print(facebook.VALID_API_VERSIONS) 顯示列表資訊是?
04/13 15:24, 1F

04/13 15:25, 7年前 , 2F
最有可能是你裝的版本 module 太舊當時候版本不支援2.12
04/13 15:25, 2F
文章代碼(AID): #1Qq2lzi2 (Python)
文章代碼(AID): #1Qq2lzi2 (Python)