2

i want to use graph api on python so i can do analysis on posts. so far i tried to import the library:

import facebook

but i got the error

import facebook
  File "C:\Users\matan\Desktop\Machine Learning Forex\facebook.py", line 11
    pip install -e git+https://github.com/mobolic/facebook-sdk.git#egg=facebook-sdk
              ^
SyntaxError: invalid syntax

  File "C:\Users\matan\Desktop\Machine Learning Forex\facebook.py", line 11
    pip install -e git+https://github.com/mobolic/facebook-sdk.git#egg=facebook-sdk
              ^
SyntaxError: invalid syntax

how can i import this library?

2
  • pip is not supposed to be run by the Python interpreter. Where did you find your facebook module? Aren't you missing a step in its installation? Commented Dec 17, 2017 at 13:23
  • the only command was the import facebook command facebook-sdk.readthedocs.io/en/latest/api.html Commented Dec 17, 2017 at 13:23

1 Answer 1

7

You are getting this error because you didn't install the package. Run this command to install the package - pip install facebook-sdk

Or if you are using python 3 better to run - pip3 install facebook-sdk

After installing import the package - import facebook

N.B: It's better to install released versions.

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

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.