Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GraphApi module present in pyfacebook or not

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'
like image 537
user1543087 Avatar asked Mar 23 '26 05:03

user1543087


1 Answers

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

like image 185
Rose Perrone Avatar answered Mar 25 '26 18:03

Rose Perrone



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!