3

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

2
  • Do you have any examples of the code you are trying to run/emulate? I'm sure we can get something figured out. Commented Nov 23, 2012 at 1:07
  • Install it using ' sudo pip install facebook-sdk ' instead Commented Dec 22, 2014 at 5:31

2 Answers 2

3

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.

Sign up to request clarification or add additional context in comments.

Comments

1

Try this sdk, this is simpler and easy to use and has got detailed doc to help beginners Facebook python sdk

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.