With making posts on Facebook with Python?

1
import facebook

token = 'meu token'



graph = facebook.GraphAPI(token)
graph.put_object("me", "feed", message="Hello, World!")

Friends,

I'm using Ubuntu and Python 2.7 and 3.5.2

The following error occurs:

"graph = facebook.GraphAPI (ACCESS_TOKEN) AttributeError: module 'facebook' has no attribute 'GraphAPI'

I've already researched Stack Overflow here but no answer solved my problem.

I installed the Facebook-SDK from here:

link

Any suggestions?

    
asked by anonymous 26.02.2017 / 02:04

1 answer

2

If you are using Ubuntu or Debian, run these commands to get it working again.

sudo pip uninstall facebook
sudo pip uninstall facebook-sdk
sudo pip install facebook-sdk

For other operating systems, just remove facebook and facebook-sdk and install only facebook-sdk

Then run the program. Note that the facebook module is deprecated and its replacement is facebook-sdk .

Response Source

.

    
26.02.2017 / 02:20