문제

i have installed pyfacebook as well as python sdk even the i am getting error as follows

when using this code

import facebook
token = 'my token'
graph = facebook.GraphAPI(token)
profile = graph.get_object("me")
friends = graph.get_connections("me", "friends")
friend_list = [friend['name'] for friend in friends['data']]
print friend_list

    

error that i am facing is

graph = facebook.GraphAPI(token)
AttributeError: 'module' object has no attribute 'GraphAPI'

올바른 솔루션이 없습니다

다른 팁

I had this problem when I install the facebook module using easy_install facebook. It worked when I ran the following instead:

git clone https://github.com/pythonforfacebook/facebook-sdk.git pip install facebook-sdk

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top