Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Troubles installing Facbeook SDK for Python

I have downloaded the Facebook SDK from:

https://github.com/pythonforfacebook/facebook-sdk/

In my Python install folder, I created a folder called fb and extracted the files from GitHub into this folder. I then ran:

setup.py install

To install the module. However, when I try and run

from facebook import Facebook

in the Python Shell I get the following:

>>> from facebook import Facebook

Traceback (most recent call last): File pyshell#0, line 1, in from facebook import Facebook ImportError: cannot import name Facebook

However when I simply write from facebook import *, I receive no errors.

What step haven't I taken to get this working correctly? Thanks

like image 617
user1846276 Avatar asked Feb 22 '26 08:02

user1846276


1 Answers

It looks like you're doing everything correctly - your problem is that there isn't a Facebook object inside of the facebook module (see the code here). The reason the * import works is because that is the syntax to import all names. From your code, you should be able to simply use facebook.<your_method> to call what you want.

like image 58
RocketDonkey Avatar answered Feb 24 '26 20:02

RocketDonkey



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!